kasket 0.7.1 → 0.7.2
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.
- 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
|