custom_counter_cache 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -41,7 +41,7 @@ module CustomCounterCache::Model
|
|
41
41
|
# define callback
|
42
42
|
define_method method_name do
|
43
43
|
# update old association
|
44
|
-
if send("#{foreign_key}_changed?") || (
|
44
|
+
if send("#{foreign_key}_changed?") || ( respond_to?("#{association}_type") && send("#{association}_type_changed?") )
|
45
45
|
old_id = send("#{foreign_key}_was")
|
46
46
|
klass = if reflection.options[:polymorphic]
|
47
47
|
( send("#{association}_type_was") || send("#{association}_type") ).constantize
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: custom_counter_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Cedric Howe
|