4
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/kasket/reload_association_mixin.rb', line 4
def reload_with_kasket_clearing(*args)
if loaded?
Kasket.clear_local if target.class.include?(WriteMixin)
else
refl = (ActiveRecord::VERSION::MAJOR == 2 || AR30) ? proxy_reflection : reflection
target_class = (refl.options[:polymorphic] ? (respond_to?(:klass) ? klass : association_class) : refl.klass)
Kasket.clear_local if target_class && target_class.include?(WriteMixin)
end
reload_without_kasket_clearing(*args)
end
|