has_many_through.rb 353 字节
Newer Older
J
Jon Leighton 已提交
1 2 3 4 5 6 7
module ActiveRecord
  module Associations
    class Preloader
      class HasManyThrough < CollectionAssociation #:nodoc:
        include ThroughAssociation

        def associated_records_by_owner
8
          super.each_value do |records|
9
            records.uniq! if reflection_scope.distinct_value
J
Jon Leighton 已提交
10 11 12 13 14 15
          end
        end
      end
    end
  end
end