Sha256: aebab35f8e752c88ac8796af0d1f493b23f29dc5f97e06b6cb18e70e427c0b68
Contents?: true
Size: 642 Bytes
Versions: 1
Compression:
Stored size: 642 Bytes
Contents
# -*- encoding: utf-8 -*- module Kasket module ReloadAssociationMixin def reload_with_kasket_clearing(*args) if loaded? Kasket.clear_local if target.class.include?(WriteMixin) else refl = respond_to?(:reflection) ? reflection : proxy_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 def self.included(base) base.alias_method_chain :reload, :kasket_clearing end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kasket-2.1.0 | lib/kasket/reload_association_mixin.rb |