activerecord-prunable 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97a945f1fcb57b06d59c5153a1e134a91c38c76f
4
- data.tar.gz: e32147dd1b243909a3fb972516ff22ff9c291d23
3
+ metadata.gz: ee37713079a5a97f560f7a5f7097b7964e0972e6
4
+ data.tar.gz: d10414c12f3c76966518574dca18cef65e9da778
5
5
  SHA512:
6
- metadata.gz: f27076f89b6decfa04c070d7cc6145b6e9c54c7c71a4903d82d6f8f8cc126eb0f5f3334252cc18cef590475acfd8410d2433594d0aa0793f6ed0a86354679a5b
7
- data.tar.gz: 6dc95f9b93600595fe7188207d7c9aead81e3acef805fc2d98602bcc32bd5c2fb9e185ef789bccb9312b588d11b5e3709c38bdc65ccebb90d28db0aa3bfe2427
6
+ metadata.gz: 7fa8cb1090569daf9961710a42706630cf900c16984ab1532d27be70dc32bfbb355e05875bf5ada1b7c2f328c8561d8659cfe5fc0030c719f7c9b92ce8a5edc2
7
+ data.tar.gz: 16b036c67c94558129661f2282e476eb64f21ff0d731dc033e4eeebd1622d25bd07e9dcaff1902ce1b0cbda1895642253b33d90d9c4e5dddf06e6b4202799b07
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-prunable (0.2.2)
4
+ activerecord-prunable (0.3.1)
5
5
  activerecord (>= 3.0, < 5.0)
6
6
  activesupport (>= 3.0, < 5.0)
7
7
 
data/README.md CHANGED
@@ -21,8 +21,9 @@ Or install it yourself as:
21
21
 
22
22
  ## Usage
23
23
 
24
- 1. Include the `Prunable` module in the ActiveRecord model which needs to be pruned.
25
- 2. Define the `:prunable` scope which returns models to prune.
24
+ __1. Include the `Prunable` module in the ActiveRecord model which needs to be pruned.__
25
+
26
+ __2. Define the `:prunable` scope which returns models to prune.__
26
27
 
27
28
  ```ruby
28
29
  class Notification < ApplicationRecord
@@ -50,7 +51,7 @@ Or install it yourself as:
50
51
  `prune_created_after(TTL)` defines `where('created_at < ?', current_time - TTL)` prunable scope
51
52
  `prune_updated_after(TTL)` defines `where('updated_at < ?', current_time - TTL)` prunable scope
52
53
 
53
- 3. Add a `Prunable.prune!` call to a periodic task.
54
+ __3. Add a `Prunable.prune!` call to a periodic task.__
54
55
 
55
56
  Example:
56
57
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "activerecord-prunable"
3
- spec.version = "0.3.0"
3
+ spec.version = "0.3.1"
4
4
  spec.authors = ["dr2m"]
5
5
  spec.email = ["maletin@maletin.work"]
6
6
 
@@ -11,11 +11,11 @@ module Prunable
11
11
  ActiveRecord::Prunable.includes
12
12
  end
13
13
 
14
- def prune!(*models, prune_method: nil, params: [])
14
+ def prune!(*models, prune_method: nil, current_time: nil, params: [])
15
15
  models = self.models if models.empty?
16
16
 
17
17
  models.each do |model|
18
- model.prune!(*params, prune_method: prune_method)
18
+ model.prune!(*params, prune_method: prune_method, current_time: current_time)
19
19
  end
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-prunable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - dr2m
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-01 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec