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