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

    def initialize(relation, *groupings, &block)
      @relation = relation
      @groupings = (groupings + (block_given?? [yield(relatoin)] : [])).collect { |g| g.bind(relation) }
    end

    def externalizable?
      true
    end
  end
end