active_tools 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: 32a0d6d2230e3c9550d6d2f945ee7a979bad0eda3000ec046145073a588d9dcc
4
- data.tar.gz: 414a438c1f649b9ef4e870fafd91a094fc43472e759142ab4f3a4f3855bfa0a7
3
+ metadata.gz: 9c560196a4a3a56c27297ad9ab281a5bdb93946e34c8970b16b1ae135e777ec6
4
+ data.tar.gz: afde06281bf20281359ce7e8cf51f24bf60d86fc9b3219075568bcec33f4cde5
5
5
  SHA512:
6
- metadata.gz: b7350ce462a08f8c32fe9c1769624e98c778c253990baea5a04df0cdb1d3d3b0dca42328e87f08393a608ea58b173a2139e5676820b098f28b3e8737979484cd
7
- data.tar.gz: 6e3d48cfae2b0dc45ff83ecf245ef1c64a2500553eba285e9c43456069aee75347ede1a7f3cf9e0ca889deb34e1fdd4316b5c2dd594bbb48ff76b9395277b0f0
6
+ metadata.gz: ffa4619e0d971fe9c1ecb6f22868c5afbb8497c29ff2013afddf047526c6d572c3965cf1789049a2b2ca4b80cadffd609a731eeb541ecc5e489b449d0e3c4c40
7
+ data.tar.gz: f3dd0cb1a285299117ad00da2be8f8ae3ab9a4201778187a3d6874ed4865386eed3a065ec1fa5492b07f82cfff0d2ecac71cc527a4558e8c0e42bea9d9dd9a28
@@ -7,7 +7,7 @@ module ActiveTools
7
7
  end
8
8
 
9
9
  module ClassMethods
10
- def commit_and_touch(*args)
10
+ def commit_and_touch(*args, &block)
11
11
  options = args.extract_options!
12
12
 
13
13
  class_attribute :commit_and_touch_options unless defined?(commit_and_touch_options)
@@ -17,7 +17,12 @@ module ActiveTools
17
17
 
18
18
  after_commit options do
19
19
  self.commit_and_touch_options[:reflections].each do |assoc|
20
- send(assoc).update_all(:updated_at => Time.now)
20
+ attributes = if block_given?
21
+ block.call(self)
22
+ else
23
+ {:updated_at => Time.now}
24
+ end
25
+ send(assoc).update_all(attributes)
21
26
  end
22
27
  end
23
28
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveTools
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valery Kvon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-02 00:00:00.000000000 Z
11
+ date: 2018-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails