active_tools 0.0.34 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61ac99dabcb4e537d397d077f57a9f1e90303e5d
4
- data.tar.gz: 08399e6f9aae134f98347560bf4c1ff9c13719e2
3
+ metadata.gz: 036261047b11ed88976a1cfa00f1a262b4eb5348
4
+ data.tar.gz: eed87911c09acbbee7edbe65042bba8c722bb660
5
5
  SHA512:
6
- metadata.gz: 7002e7e85eaa2705db0dbb74f161bbf84111cf40fa755e33b7e439e3500caa2ce6656c2884d280800746a106e326df205d681760a27dd96335f897f6b8a443e1
7
- data.tar.gz: f81067f711edc309b958bd0e08df0e0fa623762cdcc0b416e4c5af61e6249bb2d2213d357fa1b1557f6107e3a7128af8c01e55faf582dab1e634c269e12dec8a
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
- unless method_defined? :custom_counter_cache_after_create
27
- include ActiveRecord::CustomCounterCache::InstanceMethods
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
- after_create lambda { |record|
31
- record.custom_counter_cache_after_create(assoc_name, reflection, assoc_mapping)
32
- }
29
+ after_create lambda { |record|
30
+ record.custom_counter_cache_after_create(assoc_name, reflection, assoc_mapping)
31
+ }
33
32
 
34
- before_destroy lambda { |record|
35
- record.custom_counter_cache_before_destroy(assoc_name, reflection, assoc_mapping)
36
- }
33
+ before_destroy lambda { |record|
34
+ record.custom_counter_cache_before_destroy(assoc_name, reflection, assoc_mapping)
35
+ }
37
36
 
38
- after_update lambda { |record|
39
- record.custom_counter_cache_after_update(assoc_name, reflection, assoc_mapping)
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
@@ -1,3 +1,3 @@
1
1
  module ActiveTools
2
- VERSION = "0.0.34"
2
+ VERSION = "0.0.35"
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.0.34
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-13 00:00:00.000000000 Z
11
+ date: 2016-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails