diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2015-12-22 17:12:34 -0200 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2015-12-22 17:12:34 -0200 |
commit | 90815ce412b6341c7372e1e514d9078869b4b933 (patch) | |
tree | e4e2fafdf448cb6090b0ba94caef13a32e825aa8 /activerecord/lib/active_record/relation.rb | |
parent | d182c22e915b4d5d97d171b9c612b6c37c7d6ded (diff) | |
parent | c548298e76026465c2e358f9ff1d83c8c404b587 (diff) | |
download | rails-90815ce412b6341c7372e1e514d9078869b4b933.tar.gz rails-90815ce412b6341c7372e1e514d9078869b4b933.tar.bz2 rails-90815ce412b6341c7372e1e514d9078869b4b933.zip |
Merge pull request #22620 from kamipo/join_to_delete_is_same_as_join_to_update
`join_to_delete` is same as `join_to_update`
Diffstat (limited to 'activerecord/lib/active_record/relation.rb')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 2cf19c76c5..316b0d6308 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -371,11 +371,11 @@ module ActiveRecord stmt.set Arel.sql(@klass.send(:sanitize_sql_for_assignment, updates)) stmt.table(table) - stmt.key = table[primary_key] if joins_values.any? - @klass.connection.join_to_update(stmt, arel) + @klass.connection.join_to_update(stmt, arel, table[primary_key]) else + stmt.key = table[primary_key] stmt.take(arel.limit) stmt.order(*arel.orders) stmt.wheres = arel.constraints |