You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 28, 2020. It is now read-only.
Merge pull request #1 in ~V.PROMZELEV/activerecord-overflow_signalizer from CNAV-6892 to master
* commit 'a08d8eac92be8d0e292385f8b9221f682997ea3b':
update README.md
do not retrive pk if table is empty
specify max values of types as hash
fix variable name
move predicate to method
support custom signalizers
use appraisals in travis
update .gitignore
use appraisals for testing with different versions of activerecord
update README.md
It will be placed on github.com
basic functionality
settings for test database
actualize naming
debugging gems
doesnt log anything if all ok
Copy file name to clipboardExpand all lines: README.md
+49-10Lines changed: 49 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,6 @@
1
-
# Activerecord::OverflowSignalizer
1
+
# ActiveRecord::OverflowSignalizer
2
2
3
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/activerecord/overflow_signalizer`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
-
TODO: Delete this and the text above, and describe your gem
3
+
One day primary key field will overflow, but if you use this gem, you will know about it before it happened.
6
4
7
5
## Installation
8
6
@@ -22,18 +20,59 @@ Or install it yourself as:
22
20
23
21
## Usage
24
22
25
-
TODO: Write usage instructions here
23
+
Just placed it somewhere in your app:
24
+
```ruby
25
+
ActiveRecord::OverflowSignalizer.new.analyse!
26
+
```
26
27
27
-
## Development
28
+
By default it check all models in your application and log if some primary key will overflow soon or overflowed.
28
29
29
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
You can placed it in some job and perform it by [clockwork](https://github.com/adamwiggins/clockwork)
31
+
or just run it when app started in separated thread.
30
32
31
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
+ You can use own signalizer for sending notification to e-mail, slack, hipchat, etc.
54
+
```ruby
55
+
classMyAwesomeSignalizer
56
+
definitialize(some_params)
57
+
@notifier=SomeChatNotifier.new(some_params)
58
+
end
59
+
60
+
defsignalize(msg)
61
+
@notifier.send_msg(msg)
62
+
end
63
+
end
34
64
35
-
Bug reports and pull requests are welcome on GitHub at https://github.com/v.promzelev/activerecord-overflow_signalizer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
For tests you need postgresql connection specified in `spec/database.yml`.
72
+
73
+
## Contributing
36
74
75
+
Bug reports and pull requests are welcome on GitHub at https://github.com/funbox/activerecord-overflow_signalizer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
0 commit comments