kasket 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kasket.rb +1 -1
- data/lib/kasket/reload_association_mixin.rb +7 -1
- metadata +1 -1
data/lib/kasket.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
module Kasket
|
2
2
|
module ReloadAssociationMixin
|
3
|
+
# TODO write tests for this
|
3
4
|
def reload_with_kasket_clearing(*args)
|
4
|
-
|
5
|
+
if loaded?
|
6
|
+
Kasket.clear_local if target.class.include?(WriteMixin)
|
7
|
+
else
|
8
|
+
target_class = proxy_reflection.options[:polymorphic] ? association_class : proxy_reflection.klass
|
9
|
+
Kasket.clear_local if target_class.include?(WriteMixin)
|
10
|
+
end
|
5
11
|
|
6
12
|
reload_without_kasket_clearing(*args)
|
7
13
|
end
|