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

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