Sha256: 483e85d19b3502b77b6ff1768139427d6327b13eb1ede6d7dea27f3c0fc4f5cf

Contents?: true

Size: 485 Bytes

Versions: 223

Compression:

Stored size: 485 Bytes

Contents

module ActiveRecord
  module Associations
    class Preloader
      class SingularAssociation < Association #:nodoc:

        private

        def preload
          associated_records_by_owner.each do |owner, associated_records|
            record = associated_records.first

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

      end
    end
  end
end

Version data entries

223 entries across 192 versions & 15 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/activerecord-3.2.22.5/lib/active_record/associations/preloader/singular_association.rb
activerecord-3.2.22.5 lib/active_record/associations/preloader/singular_association.rb
activerecord-3.2.22.4 lib/active_record/associations/preloader/singular_association.rb
activerecord-3.2.22.3 lib/active_record/associations/preloader/singular_association.rb
activerecord-3.2.22.2 lib/active_record/associations/preloader/singular_association.rb
activerecord-3.2.22.1 lib/active_record/associations/preloader/singular_association.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/preloader/singular_association.rb
activerecord-3.2.22 lib/active_record/associations/preloader/singular_association.rb
activerecord-4.0.13 lib/active_record/associations/preloader/singular_association.rb
activerecord-4.0.13.rc1 lib/active_record/associations/preloader/singular_association.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.12/lib/active_record/associations/preloader/singular_association.rb
activerecord-4.0.11.1 lib/active_record/associations/preloader/singular_association.rb
activerecord-4.0.12 lib/active_record/associations/preloader/singular_association.rb
activerecord-3.2.21 lib/active_record/associations/preloader/singular_association.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.18/lib/active_record/associations/preloader/singular_association.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/associations/preloader/singular_association.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/activerecord-3.2.18/lib/active_record/associations/preloader/singular_association.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.18/lib/active_record/associations/preloader/singular_association.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/associations/preloader/singular_association.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/activerecord-3.2.18/lib/active_record/associations/preloader/singular_association.rb