aboutsummaryrefslogblamecommitdiffstats
path: root/lib/arel/relations/operations/group.rb
blob: bc3a7f34379107d5c312c8a31d6f933a83f1534e (plain) (tree)
1
2
3
4
5
6
7
8
9
           
                        
                          





                                                                                  
                                        

                                        






                    
module Arel
  class Group < Compound
    attr_reader :groupings

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

    def ==(other)
      Group       === other          and
      relation    ==  other.relation and
      groupings   ==  other.groupings
    end

    def aggregation?
      true
    end
  end
end