1 2 3 4 5 6 7 8 9 10 11 12
module Arel class Deletion < Compound def to_sql(formatter = nil) [ "DELETE", "FROM #{table_sql}", ("WHERE #{wheres.collect(&:to_sql).join('\n\tAND ')}" unless wheres.blank? ), ("LIMIT #{taken}" unless taken.blank? ), ].compact.join("\n") end end end