Sha256: 3f255b3488dae503e45455f1b5332f0c50441b78a6093ef9286836618ca510ae
Contents?: true
Size: 640 Bytes
Versions: 95
Compression:
Stored size: 640 Bytes
Contents
module ActiveRecord module Associations class Preloader class CollectionAssociation < Association #:nodoc: private def build_scope super.order(preload_scope.values[:order] || reflection_scope.values[:order]) end def preload(preloader) associated_records_by_owner(preloader).each do |owner, records| association = owner.association(reflection.name) association.loaded! association.target.concat(records) records.each { |record| association.set_inverse_instance(record) } end end end end end end
Version data entries
95 entries across 91 versions & 8 rubygems