aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/operations/group.rb
blob: f3666cacf838bd9eee6cfd2f39fd562b5f560b11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Arel
  class Group < Compound
    attr_reader :groupings

    def initialize(relation, groupings)
      super(relation)
      @groupings = groupings.collect { |g| g.bind(relation) }
    end

    def == other
      super ||
        self.class === other &&
        @relation == other.relation &&
        @groupings == other.groupings
    end

    def eval
      raise NotImplementedError
    end
  end
end