Class: ActiveRecord::Associations::Preloader::HasManyThrough

Inherits:
CollectionAssociation show all
Includes:
ThroughAssociation
Defined in:
lib/active_record/associations/preloader/has_many_through.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from CollectionAssociation

#proxy

Attributes inherited from Association

#owner, #reflection, #target

Instance Method Summary collapse

Methods included from ThroughAssociation

#source_reflection, #through_reflection

Methods inherited from CollectionAssociation

#add_to_target, #any?, #build, #concat, #count, #create, #create!, #delete, #delete_all, #delete_all_on_destroy, #destroy, #destroy_all, #empty?, #find, #first, #ids_reader, #ids_writer, #include?, #initialize, #last, #length, #load_target, #many?, #reader, #replace, #reset, #select, #size, #sum, #transaction, #uniq, #writer

Methods inherited from Association

#aliased_table_name, #association_scope, #initialize, #interpolate, #klass, #load_target, #loaded!, #loaded?, #reload, #reset, #reset_scope, #scoped, #set_inverse_instance, #stale_target?, #target_scope

Constructor Details

This class inherits a constructor from ActiveRecord::Associations::CollectionAssociation

Instance Method Details

#associated_records_by_ownerObject



7
8
9
10
11
# File 'lib/active_record/associations/preloader/has_many_through.rb', line 7

def associated_records_by_owner
  super.each do |owner, records|
    records.uniq! if options[:uniq]
  end
end