Class: Prosperity::Aggregate::Average
- Inherits:
-
WithColumn
- Object
- WithColumn
- Prosperity::Aggregate::Average
- Defined in:
- lib/prosperity/aggregate/average.rb
Instance Attribute Summary
Attributes inherited from WithColumn
Instance Method Summary collapse
Methods inherited from WithColumn
Constructor Details
This class inherits a constructor from Prosperity::Aggregate::WithColumn
Instance Method Details
#apply(scope, options = {}) ⇒ Object
7 8 9 |
# File 'lib/prosperity/aggregate/average.rb', line 7 def apply(scope, = {}) scope.average(column) end |
#to_sql ⇒ Object
3 4 5 |
# File 'lib/prosperity/aggregate/average.rb', line 3 def to_sql "AVG(#{column})" end |