Sha256: 843118e9abe60fc1d7d4a57df60eda4143c21ed8d6b64501b07722be334d53a1

Contents?: true

Size: 421 Bytes

Versions: 55

Compression:

Stored size: 421 Bytes

Contents

module ActiveRecord
  module Associations
    class Preloader
      class HasManyThrough < CollectionAssociation #:nodoc:
        include ThroughAssociation

        def associated_records_by_owner(preloader)
          records_by_owner = super

          if reflection_scope.distinct_value
            records_by_owner.each_value(&:uniq!)
          end

          records_by_owner
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 4 rubygems

Version Path
activerecord-5.1.7 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.7.rc1 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.6.2 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.7.2 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.6.1 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.7.1 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.6 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.7 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.5 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.5.rc1 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.4 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.6 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.4.rc1 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.6.rc1 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.3 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.3.rc3 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.5 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.5.rc2 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.1.3.rc2 lib/active_record/associations/preloader/has_many_through.rb
activerecord-5.0.5.rc1 lib/active_record/associations/preloader/has_many_through.rb