Method: ActiveRecord::Reflection::ClassMethods#reflect_on_aggregation

Defined in:
activerecord/lib/active_record/reflection.rb

#reflect_on_aggregation(aggregation) ⇒ Object

Returns the AggregateReflection object for the named aggregation (use the symbol).

Account.reflect_on_aggregation(:balance) # => the balance AggregateReflection


70
71
72
# File 'activerecord/lib/active_record/reflection.rb', line 70

def reflect_on_aggregation(aggregation)
  aggregate_reflections[aggregation.to_sym]
end