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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c560196a4a3a56c27297ad9ab281a5bdb93946e34c8970b16b1ae135e777ec6
|
4
|
+
data.tar.gz: afde06281bf20281359ce7e8cf51f24bf60d86fc9b3219075568bcec33f4cde5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/active_tools/version.rb
CHANGED
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
|
+
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-
|
11
|
+
date: 2018-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|