diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader/has_many_through.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/has_many_through.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/has_many_through.rb b/activerecord/lib/active_record/associations/preloader/has_many_through.rb new file mode 100644 index 0000000000..c6e9ede356 --- /dev/null +++ b/activerecord/lib/active_record/associations/preloader/has_many_through.rb @@ -0,0 +1,15 @@ +module ActiveRecord + module Associations + class Preloader + class HasManyThrough < CollectionAssociation #:nodoc: + include ThroughAssociation + + def associated_records_by_owner + super.each do |owner, records| + records.uniq! if options[:uniq] + end + end + end + end + end +end |