aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-20 22:27:22 +0900
committerGitHub <noreply@github.com>2019-02-20 22:27:22 +0900
commitceed0aa2e0e45523496130e5a5c4a4f032e8cd2a (patch)
tree09b1dfbb51826921f83ffbeede9ddfbd295af267 /activerecord/lib/active_record/persistence.rb
parentdf2ebf9b59b8ef063923136ba7097328db6c949f (diff)
parent11c34d8ef44b95b3989cb8376af09842293c892c (diff)
downloadrails-ceed0aa2e0e45523496130e5a5c4a4f032e8cd2a.tar.gz
rails-ceed0aa2e0e45523496130e5a5c4a4f032e8cd2a.tar.bz2
rails-ceed0aa2e0e45523496130e5a5c4a4f032e8cd2a.zip
Merge pull request #35327 from abhaynikam/use-delete-by-and-destroy-by-method
Replaced usage of where.delete/destroy_all with delete/destroy_by
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 510a275b4e..7763496519 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -161,7 +161,7 @@ module ActiveRecord
# # Delete multiple rows
# Todo.delete([2,3,4])
def delete(id_or_array)
- where(primary_key => id_or_array).delete_all
+ delete_by(primary_key => id_or_array)
end
def _insert_record(values) # :nodoc: