Method: ActiveRecord::Reflection::ClassMethods#reflect_on_association

Defined in:
lib/ocean-dynamo/active_record_stuff/reflection.rb

#reflect_on_association(association) ⇒ Object

Returns the AssociationReflection object for the association (use the symbol).

.reflect_on_association(:owner)             # returns the owner AssociationReflection
Invoice.reflect_on_association(:line_items).macro  # returns :has_many


67
68
69
70
# File 'lib/ocean-dynamo/active_record_stuff/reflection.rb', line 67

def reflect_on_association(association)
  reflection = reflections[association]
  reflection if reflection.is_a?(AssociationReflection)
end