1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
# frozen_string_literal: true
module Arel # :nodoc: all
module Nodes
class DeleteStatement < Arel::Nodes::Node
attr_accessor :relation, :wheres, :groups, :havings, :orders, :limit, :offset, :key
def initialize(relation = nil, wheres = [])
super()
@relation = relation
@wheres = wheres
@groups = []
@havings = []
@orders = []
@limit = nil
@offset = nil
@key = nil
end
def initialize_copy(other)
super
@relation = @relation.clone if @relation
@wheres = @wheres.clone if @wheres
end
def hash
[self.class, @relation, @wheres, @orders, @limit, @offset, @key].hash
end
def eql?(other)
self.class == other.class &&
self.relation == other.relation &&
self.wheres == other.wheres &&
self.orders == other.orders &&
self.groups == other.groups &&
self.havings == other.havings &&
self.limit == other.limit &&
self.offset == other.offset &&
self.key == other.key
end
alias :== :eql?
end
end
end
|