aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_association.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2013-03-30 15:47:38 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2013-03-30 15:47:38 +0530
commite63086c135bf17a43e0807ecdef3e54b22048152 (patch)
tree89f51923c9ea02d49f4ea97e8ec3dc0f5e3c5119 /activerecord/lib/active_record/associations/has_many_association.rb
parent06e22c01e86e47ebe0835e4c6ec351175cf91b96 (diff)
parent6d8c070821bc846eb263b8c045ae652ebd751569 (diff)
downloadrails-e63086c135bf17a43e0807ecdef3e54b22048152.tar.gz
rails-e63086c135bf17a43e0807ecdef3e54b22048152.tar.bz2
rails-e63086c135bf17a43e0807ecdef3e54b22048152.zip
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index f59565ae77..29fae809da 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -22,10 +22,11 @@ module ActiveRecord
else
if options[:dependent] == :destroy
# No point in executing the counter update since we're going to destroy the parent anyway
- load_target.each(&:mark_for_destruction)
+ load_target.each { |t| t.destroyed_by_association = reflection }
+ destroy_all
+ else
+ delete_all
end
-
- delete_all
end
end