1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
class DeletionRelation < CompoundRelation attr_reader :relation def ==(other) relation == other.relation end def initialize(relation) @relation = relation end def to_sql(builder = DeleteBuilder.new) builder.call do delete from table where do selects.each { |s| s.to_sql(self) } end end end end