instance method
reflect_on_association
Ruby on Rails 7.2.3
Since v2.2.3Signature
reflect_on_association(association)
Returns the AssociationReflection object for the association (use the symbol).
Account.reflect_on_association(:owner) # returns the owner AssociationReflection Invoice.reflect_on_association(:line_items).macro # returns :has_many
Parameters
-
associationreq
Source
# File activerecord/lib/active_record/reflection.rb, line 122
def reflect_on_association(association)
normalized_reflections[association.to_sym]
end
Defined in activerecord/lib/active_record/reflection.rb line 122
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Reflection::ClassMethods