instance method
reflect_on_association
Ruby on Rails 2.2.3
Since v2.2.3Signature
reflect_on_association(association)
Returns the AssociationReflection object for the named association (use the symbol). Example:
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 65
def reflect_on_association(association)
reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil
end
Defined in activerecord/lib/active_record/reflection.rb line 65
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Reflection::ClassMethods