method
reset_association
v4.2.1 -
Show latest stable
- Class:
ActiveRecord::Associations::Preloader::ThroughAssociation
reset_association(owners, association_name)private
No documentation available.
# File activerecord/lib/active_record/associations/preloader/through_association.rb, line 62
def reset_association(owners, association_name)
should_reset = (through_scope != through_reflection.klass.unscoped) ||
(reflection.options[:source_type] && through_reflection.collection?)
# Don't cache the association - we would only be caching a subset
if should_reset
owners.each { |owner|
owner.association(association_name).reset
}
end
end