From 6e43a207c6d3072d10b494d605b7bb6635043e30 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 1 Apr 2019 15:04:11 +0900 Subject: Revert unused code and re-using query annotation for `update_all` and `delete_all` This partly reverts #35617. #35617 includes unused code (for `InsertStatement`) and re-using query annotation for `update_all` and `delete_all`, which has not been discussed yet. If a relation has any annotation, I think it is mostly for SELECT query, so re-using annotation by default is not always desired behavior for me. We should discuss about desired behavior before publishing the implementation. --- activerecord/lib/arel/nodes/delete_statement.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'activerecord/lib/arel/nodes/delete_statement.rb') diff --git a/activerecord/lib/arel/nodes/delete_statement.rb b/activerecord/lib/arel/nodes/delete_statement.rb index 56249b2bad..a419975335 100644 --- a/activerecord/lib/arel/nodes/delete_statement.rb +++ b/activerecord/lib/arel/nodes/delete_statement.rb @@ -3,7 +3,7 @@ module Arel # :nodoc: all module Nodes class DeleteStatement < Arel::Nodes::Node - attr_accessor :left, :right, :orders, :limit, :offset, :key, :comment + attr_accessor :left, :right, :orders, :limit, :offset, :key alias :relation :left alias :relation= :left= @@ -18,18 +18,16 @@ module Arel # :nodoc: all @limit = nil @offset = nil @key = nil - @comment = nil end def initialize_copy(other) super @left = @left.clone if @left @right = @right.clone if @right - @comment = @comment.clone if @comment end def hash - [self.class, @left, @right, @orders, @limit, @offset, @key, @comment].hash + [self.class, @left, @right, @orders, @limit, @offset, @key].hash end def eql?(other) @@ -39,8 +37,7 @@ module Arel # :nodoc: all self.orders == other.orders && self.limit == other.limit && self.offset == other.offset && - self.key == other.key && - self.comment == other.comment + self.key == other.key end alias :== :eql? end -- cgit v1.2.3