method
through_records_by_owner
v4.0.2 -
Show latest stable
- Class:
ActiveRecord::Associations::Preloader::ThroughAssociation
through_records_by_owner()private
No documentation available.
# File activerecord/lib/active_record/associations/preloader/through_association.rb, line 27
def through_records_by_owner
Preloader.new(owners, through_reflection.name, through_scope).run
Hash[owners.map do |owner|
through_records = Array.wrap(owner.send(through_reflection.name))
# Dont cache the association - we would only be caching a subset
if (through_scope != through_reflection.klass.unscoped) ||
(reflection.options[:source_type] && through_reflection.collection?)
owner.association(through_reflection.name).reset
end
[owner, through_records]
end]
end