1
1
# ActiveRecord::OverflowSignalizer
2
2
3
- One day primary key field will overflow, but if you use this gem, you will know about it before it happened .
3
+ One day primary key field will overflow, but if you use this gem, you will know about it before it happens .
4
4
5
5
## Installation
6
6
@@ -20,17 +20,17 @@ Or install it yourself as:
20
20
21
21
## Usage
22
22
23
- Just placed it somewhere in your app:
23
+ Just place it somewhere in your app:
24
24
``` ruby
25
25
ActiveRecord ::OverflowSignalizer .new .analyse!
26
26
```
27
27
28
- By default it check all models in your application and log if some primary key will overflow soon or overflowed.
28
+ By default it checks all models in your application and logs if some primary key will overflow soon or overflowed.
29
29
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
+ You can place it in some job and perform it by [ clockwork] ( https://github.com/adamwiggins/clockwork )
31
+ or just run it when app starts in a separate thread.
32
32
33
- Also you can pass some parameters in initializer:
33
+ Also you can pass some parameters to the initializer:
34
34
35
35
+ Specify logger
36
36
``` ruby
@@ -42,15 +42,15 @@ By default ActiveRecord::Base.logger
42
42
``` ruby
43
43
ActiveRecord ::OverflowSignalizer .new (models: [ModelName ])
44
44
```
45
- By default it retrieve all descendants of ActiveRecord::Base
45
+ By default it retrieves all descendants of ActiveRecord::Base
46
46
47
- + Specify count of days. Gem start notify you if some primary key will overflow over the next numbers of days.
47
+ + Specify count of days. Gem starts to notify you if some primary key will overflow over the next number of days.
48
48
``` ruby
49
49
ActiveRecord ::OverflowSignalizer .new (days_count: 360 )
50
50
```
51
51
60 days by default
52
52
53
- + You can use own signalizer for sending notification to e-mail, slack, hipchat, etc.
53
+ + You can use your own signalizer for notification sending to e-mail, slack, hipchat, etc.
54
54
``` ruby
55
55
class MyAwesomeSignalizer
56
56
def initialize (some_params )
64
64
65
65
ActiveRecord ::OverflowSignalizer .new (signalizer: MyAwesomeSignalizer .new (some_params))
66
66
```
67
- By default it use only logging
67
+ By default it uses only logging
68
68
69
69
## Development
70
70
71
- For tests you need postgresql connection specified in ` spec/database.yml ` .
71
+ For tests you need a postgresql connection specified in ` spec/database.yml ` .
72
72
73
73
## Contributing
74
74
0 commit comments