aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/autosave_association.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-07-21 14:44:46 +0200
committerJosé Valim <jose.valim@gmail.com>2010-07-21 14:44:46 +0200
commit01add55d6a6a67fb487afa040998575111511b6d (patch)
tree9b7917090588314729b18a4023e03edead3d1a6c /activerecord/lib/active_record/autosave_association.rb
parent96b2516c3cbcf900f2e84163baba3db7cb0e37d9 (diff)
downloadrails-01add55d6a6a67fb487afa040998575111511b6d.tar.gz
rails-01add55d6a6a67fb487afa040998575111511b6d.tar.bz2
rails-01add55d6a6a67fb487afa040998575111511b6d.zip
Revert "save on parent should not cascade to child unless child changed [#3353 state:open]"
Please check Lighthouse for more information. This reverts commit 4a0d7c1a439c6ad8d35bf514761824e51fa07df2.
Diffstat (limited to 'activerecord/lib/active_record/autosave_association.rb')
-rw-r--r--activerecord/lib/active_record/autosave_association.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index 6af384367f..7517896235 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -372,9 +372,7 @@ module ActiveRecord
if autosave && association.marked_for_destruction?
association.destroy
elsif autosave != false
- if association.new_record? || ( autosave && association.changed? )
- saved = association.save(:validate => !autosave)
- end
+ saved = association.save(:validate => !autosave) if association.new_record? || autosave
if association.updated?
association_id = association.send(reflection.options[:primary_key] || :id)