aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorPablo Herrero <pablodherrero@gmail.com>2014-11-02 21:40:47 -0300
committerPablo Herrero <pablodherrero@gmail.com>2014-11-02 21:40:47 -0300
commit0488d0021190970c894b30bd2b4b05fbeaa75f83 (patch)
tree5f4b19738f219e193e2ae2a80b18402ad133d253 /activerecord/lib/active_record/associations
parent999a07e3b992154e511135096c137c8666ae36b0 (diff)
downloadrails-0488d0021190970c894b30bd2b4b05fbeaa75f83.tar.gz
rails-0488d0021190970c894b30bd2b4b05fbeaa75f83.tar.bz2
rails-0488d0021190970c894b30bd2b4b05fbeaa75f83.zip
Avoid unnecessary allocations/calls
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb
index 04a69ba446..bde23fc116 100644
--- a/activerecord/lib/active_record/associations/has_many_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -161,7 +161,7 @@ module ActiveRecord
if scope.klass.primary_key
count = scope.destroy_all.length
else
- scope.to_a.each do |record|
+ scope.each do |record|
record._run_destroy_callbacks
end