method
add_preloaded_record_to_collection
Ruby on Rails latest stable (v7.1.3.2)
-
0 notes -
Class: ActiveRecord::AssociationPreload::ClassMethods
add_preloaded_record_to_collection(parent_records, reflection_name, associated_record)
private
Hide source
# File activerecord/lib/active_record/association_preload.rb, line 136 def add_preloaded_record_to_collection(parent_records, reflection_name, associated_record) parent_records.each do |parent_record| parent_record.send("set_#{reflection_name}_target", associated_record) end end