aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2015-12-17 06:04:35 +0900
committerRyuta Kamizono <kamipo@gmail.com>2015-12-17 12:08:00 +0900
commit59a030954d7fdf7f3705005b06b73a16e65a417e (patch)
tree8c7d00005c6adf83e4ff63da5ed5759e95f33dad /activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
parentf39aa4dd3995a9d11b426af7f12841d515673a4c (diff)
downloadrails-59a030954d7fdf7f3705005b06b73a16e65a417e.tar.gz
rails-59a030954d7fdf7f3705005b06b73a16e65a417e.tar.bz2
rails-59a030954d7fdf7f3705005b06b73a16e65a417e.zip
`join_to_delete` is same as `join_to_update`
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
index 848aeb821c..3d05f52736 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -344,18 +344,12 @@ module ActiveRecord
# The default strategy for an UPDATE with joins is to use a subquery. This doesn't work
# on MySQL (even when aliasing the tables), but MySQL allows using JOIN directly in
# an UPDATE statement, so in the MySQL adapters we redefine this to do that.
- def join_to_update(update, select) #:nodoc:
- key = update.key
+ def join_to_update(update, select, key) # :nodoc:
subselect = subquery_for(key, select)
update.where key.in(subselect)
end
-
- def join_to_delete(delete, select, key) #:nodoc:
- subselect = subquery_for(key, select)
-
- delete.where key.in(subselect)
- end
+ alias join_to_delete join_to_update
protected