active_tools 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_tools/active_record/custom_counter_cache.rb +14 -14
- data/lib/active_tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 036261047b11ed88976a1cfa00f1a262b4eb5348
|
4
|
+
data.tar.gz: eed87911c09acbbee7edbe65042bba8c722bb660
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7f515ffdac4fba954614550becf526add509b92234e9877965570693592555b1c6e36a3048880b44de97a54c50efc04810d0bbb9748ab4eaefad24f525cab43
|
7
|
+
data.tar.gz: 558210deda20c3a546f8b861b5e9efd1f5aaa9e86aa8ed7e23d7453f2e889d9b4ee72322342baebece51a8c08d1a8ea20ca055ce7502ca25d098e6eeff556ea5
|
@@ -21,23 +21,23 @@ module ActiveTools
|
|
21
21
|
else
|
22
22
|
assoc_mapping = value
|
23
23
|
end
|
24
|
-
reflection = reflections[assoc_name.to_s]
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
24
|
+
if (reflection = reflections[assoc_name.to_s])
|
25
|
+
unless method_defined? :custom_counter_cache_after_create
|
26
|
+
include ActiveRecord::CustomCounterCache::InstanceMethods
|
27
|
+
end
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
after_create lambda { |record|
|
30
|
+
record.custom_counter_cache_after_create(assoc_name, reflection, assoc_mapping)
|
31
|
+
}
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
before_destroy lambda { |record|
|
34
|
+
record.custom_counter_cache_before_destroy(assoc_name, reflection, assoc_mapping)
|
35
|
+
}
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
after_update lambda { |record|
|
38
|
+
record.custom_counter_cache_after_update(assoc_name, reflection, assoc_mapping)
|
39
|
+
}
|
40
|
+
end
|
41
41
|
end
|
42
42
|
end
|
43
43
|
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.0.
|
4
|
+
version: 0.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Valery Kvon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|