method
through_records_by_owner
v3.1.0 -
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 30
def through_records_by_owner
ActiveRecord::Associations::Preloader.new(
owners, through_reflection.name,
through_options
).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 reflection.options[:source_type] && through_reflection.collection?
owner.association(through_reflection.name).reset
end
[owner, through_records]
end]
end