aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/operations/having.rb
blob: 3d8115c2f61e35efaa310ebe97f9fd6bd09ac733 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Arel
  class Having < Compound
    attr_reader :predicates

    def initialize(relation, predicates)
      super(relation)
      @predicates = predicates.map { |p| p.bind(relation) }
    end

    def havings
      @havings ||= relation.havings + predicates
    end
  end
end