module ActiveRecord::Reflection::ClassMethods
def reflect_on_association(association)
Invoice.reflect_on_association(:line_items).macro # returns :has_many
Account.reflect_on_association(:owner) # returns the owner AssociationReflection
Returns the AssociationReflection object for the +association+ (use the symbol).
def reflect_on_association(association) reflections[association.to_s] end