method
proxy_association
v7.2.3 -
Show latest stable
- Class:
ActiveRecord::Associations::CollectionProxy
proxy_association()public
Returns the association object for the collection.
class Person < ActiveRecord::Base has_many :pets end person.pets.proxy_association # => #<ActiveRecord::Associations::HasManyAssociation owner="#<Person:0x00>">
Returns the same object as person.association(:pets), allowing you to make calls like person.pets.proxy_association.owner.
See Associations::ClassMethods@Association+extensions for more.