aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-07-15 11:17:25 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-07-15 15:49:42 -0300
commit1c2545a45537661c3b1e896dd93b87377a65eb31 (patch)
treee34bbcdf7432a23b7a388519d2cd9f72e8ac5fb7 /activerecord/lib/active_record
parent714cb5a436e72d00ca0e5e6efa4b789c3e6f5b04 (diff)
downloadrails-1c2545a45537661c3b1e896dd93b87377a65eb31.tar.gz
rails-1c2545a45537661c3b1e896dd93b87377a65eb31.tar.bz2
rails-1c2545a45537661c3b1e896dd93b87377a65eb31.zip
Merge pull request #11451 from jetthoughts/11450_do_not_resave_destroyed_association
Do not re-save destroyed association on saving parent object Conflicts: activerecord/lib/active_record/autosave_association.rb Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/autosave_association.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index 3fc9d307bc..4da39299f0 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -339,6 +339,8 @@ module ActiveRecord
end
records.each do |record|
+ next if record.destroyed?
+
saved = true
if autosave != false && (@new_record_before_save || record.new_record?)