From 0f917da01a49f45c696bc0e32d14e4da811d8e6d Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Fri, 5 Mar 2021 23:48:19 +0900 Subject: [PATCH] Remove unused accessors `left` and `right` on `DeleteStatement` Use `relation` and `wheres` instead. --- .../lib/arel/nodes/delete_statement.rb | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/activerecord/lib/arel/nodes/delete_statement.rb b/activerecord/lib/arel/nodes/delete_statement.rb index a419975335..0a1a3b0e94 100644 --- a/activerecord/lib/arel/nodes/delete_statement.rb +++ b/activerecord/lib/arel/nodes/delete_statement.rb @@ -3,17 +3,12 @@ module Arel # :nodoc: all module Nodes class DeleteStatement < Arel::Nodes::Node - attr_accessor :left, :right, :orders, :limit, :offset, :key - - alias :relation :left - alias :relation= :left= - alias :wheres :right - alias :wheres= :right= + attr_accessor :relation, :wheres, :orders, :limit, :offset, :key def initialize(relation = nil, wheres = []) super() - @left = relation - @right = wheres + @relation = relation + @wheres = wheres @orders = [] @limit = nil @offset = nil @@ -22,18 +17,18 @@ module Arel # :nodoc: all def initialize_copy(other) super - @left = @left.clone if @left - @right = @right.clone if @right + @relation = @relation.clone if @relation + @wheres = @wheres.clone if @wheres end def hash - [self.class, @left, @right, @orders, @limit, @offset, @key].hash + [self.class, @relation, @wheres, @orders, @limit, @offset, @key].hash end def eql?(other) self.class == other.class && - self.left == other.left && - self.right == other.right && + self.relation == other.relation && + self.wheres == other.wheres && self.orders == other.orders && self.limit == other.limit && self.offset == other.offset &&