aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/visitors/to_sql.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-01 15:04:11 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-04-01 15:04:11 +0900
commit6e43a207c6d3072d10b494d605b7bb6635043e30 (patch)
treeb2c0ac655273cb2fedc556f62e8f902ed1e0d15c /activerecord/lib/arel/visitors/to_sql.rb
parent43866b2ca338375b964b0b905ee20f74f9b21b22 (diff)
downloadrails-6e43a207c6d3072d10b494d605b7bb6635043e30.tar.gz
rails-6e43a207c6d3072d10b494d605b7bb6635043e30.tar.bz2
rails-6e43a207c6d3072d10b494d605b7bb6635043e30.zip
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.
Diffstat (limited to 'activerecord/lib/arel/visitors/to_sql.rb')
-rw-r--r--activerecord/lib/arel/visitors/to_sql.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/arel/visitors/to_sql.rb b/activerecord/lib/arel/visitors/to_sql.rb
index 4192d9efdc..277d553e6c 100644
--- a/activerecord/lib/arel/visitors/to_sql.rb
+++ b/activerecord/lib/arel/visitors/to_sql.rb
@@ -35,7 +35,6 @@ module Arel # :nodoc: all
collect_nodes_for o.wheres, collector, " WHERE ", " AND "
collect_nodes_for o.orders, collector, " ORDER BY "
maybe_visit o.limit, collector
- maybe_visit o.comment, collector
end
def visit_Arel_Nodes_UpdateStatement(o, collector)
@@ -48,7 +47,6 @@ module Arel # :nodoc: all
collect_nodes_for o.wheres, collector, " WHERE ", " AND "
collect_nodes_for o.orders, collector, " ORDER BY "
maybe_visit o.limit, collector
- maybe_visit o.comment, collector
end
def visit_Arel_Nodes_InsertStatement(o, collector)
@@ -64,9 +62,9 @@ module Arel # :nodoc: all
maybe_visit o.values, collector
elsif o.select
maybe_visit o.select, collector
+ else
+ collector
end
-
- maybe_visit o.comment, collector
end
def visit_Arel_Nodes_Exists(o, collector)