Class: ActiveRecord::Refined::AST::GroupingSets
- Defined in:
- lib/active_record/refined/ast.rb
Overview
GROUP BY GROUPING SETS / ROLLUP / CUBE: several groupings asked for at once, the totals of each coming back beside the rows. PostgreSQL has all three and the MySQL family rollup alone; the block raises for the rest before it gets this far.
Each set is a list of its own, so grouping_sets takes lists and rollup and cube take the columns themselves.
Instance Method Summary collapse
-
#initialize(kind, sets) ⇒ GroupingSets
constructor
A new instance of GroupingSets.
Methods inherited from Node
Constructor Details
#initialize(kind, sets) ⇒ GroupingSets
Returns a new instance of GroupingSets.
1419 1420 1421 1422 1423 |
# File 'lib/active_record/refined/ast.rb', line 1419 def initialize(kind, sets) raise ArgumentError, "#{kind} needs something to group by" if sets.empty? @kind = kind @sets = sets end |