aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/operations/group.rb
blob: 2bfc42214bb8827ad45bbb6d08999ac15348b7fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
module Arel
  class Group < Compound
    attributes :relation, :groupings
    deriving :==

    def initialize(relation, *groupings, &block)
      @relation = relation
      @groupings = (groupings + arguments_from_block(relation, &block)) \
        .collect { |g| g.bind(relation) }
    end
  end
end