Sha256: 59bbe50d332867bc696a56bfc719dac53470dc11b6fb2ccd7437aab85b02b589

Contents?: true

Size: 435 Bytes

Versions: 24

Compression:

Stored size: 435 Bytes

Contents

module ActiveRecord
  module Associations
    class Preloader
      class CollectionAssociation < Association #:nodoc:
        private

        def preload(preloader)
          associated_records_by_owner(preloader).each do |owner, records|
            association = owner.association(reflection.name)
            association.loaded!
            association.target.concat(records)
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
activerecord-5.0.7.2 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.7.1 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.7 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.6 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.6.rc1 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.5 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.5.rc2 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.5.rc1 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.4 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.4.rc1 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.3 lib/active_record/associations/preloader/collection_association.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activerecord-5.0.2/lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.2 lib/active_record/associations/preloader/collection_association.rb
activerecord-5.0.2.rc1 lib/active_record/associations/preloader/collection_association.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/associations/preloader/collection_association.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/associations/preloader/collection_association.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/associations/preloader/collection_association.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/associations/preloader/collection_association.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/associations/preloader/collection_association.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/associations/preloader/collection_association.rb