Module: ActiveRecord::Refined::AST::Aggregations
- Included in:
- Arithmetic, Column, Value
- Defined in:
- lib/active_record/refined/ast.rb
Overview
Aggregate builders shared by symbols, qualified columns and expressions. Imported into the Symbol refinement like Predications, so every method must be defined with def.
Instance Method Summary collapse
- #average ⇒ Object
-
#count(distinct: false) ⇒ Object
DISTINCT is Arel's only aggregate modifier, and only for count.
- #maximum ⇒ Object
- #minimum ⇒ Object
- #sum ⇒ Object
Instance Method Details
#average ⇒ Object
207 208 209 |
# File 'lib/active_record/refined/ast.rb', line 207 def average Aggregate.new(self, :average) end |
#count(distinct: false) ⇒ Object
DISTINCT is Arel's only aggregate modifier, and only for count.
199 200 201 |
# File 'lib/active_record/refined/ast.rb', line 199 def count(distinct: false) Aggregate.new(self, :count, distinct: distinct) end |
#maximum ⇒ Object
211 212 213 |
# File 'lib/active_record/refined/ast.rb', line 211 def maximum Aggregate.new(self, :maximum) end |