method

preload

rails latest stable - Class: ActiveRecord::Associations::Preloader::SingularAssociation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.1.7) is shown here.

preload(preloader)
private

No documentation available.

# File activerecord/lib/active_record/associations/preloader/singular_association.rb, line 7
          def preload(preloader)
            associated_records_by_owner(preloader).each do |owner, associated_records|
              record = associated_records.first

              association = owner.association(reflection.name)
              association.target = record
            end
          end