module ActiveRecord::Reflection::ClassMethods
def reflect_on_aggregation(aggregation)
Account.reflect_on_aggregation(:balance) # returns the balance AggregateReflection
Returns the AggregateReflection object for the named +aggregation+ (use the symbol). Example:
def reflect_on_aggregation(aggregation) reflections[aggregation].is_a?(AggregateReflection) ? reflections[aggregation] : nil end