Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d90b4e2615
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (20 sloc) 0.597 kB
module ActiveRecord
module Associations
class Preloader
class CollectionAssociation < Association #:nodoc:
private
def build_scope
super.order(preload_options[:order] || options[:order])
end
def preload
associated_records_by_owner.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
Jump to Line
Something went wrong with that request. Please try again.