method
run
v6.0.0 -
Show latest stable
- Class:
ActiveRecord::Associations::Preloader::Association
run()public
No documentation available.
# File activerecord/lib/active_record/associations/preloader/association.rb, line 15
def run
if !preload_scope || preload_scope.empty_scope?
owners.each do |owner|
associate_records_to_owner(owner, records_by_owner[owner] || [])
end
else
# Custom preload scope is used and
# the association can not be marked as loaded
# Loading into a Hash instead
records_by_owner
end
self
end