aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/autosave_association.rb
diff options
context:
space:
mode:
authorLuca Guidi <guidi.luca@gmail.com>2009-03-12 15:24:37 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-12 15:24:37 +0000
commit47bdf3bf40ec17e1f8ca1c0e3d7f697d0c4cd1bf (patch)
treef51d913ccb78d87f47cc93a4c6c17e450013d9d3 /activerecord/lib/active_record/autosave_association.rb
parent91b98cf0a5417ce4042a0b3cd1930d5a221b737f (diff)
downloadrails-47bdf3bf40ec17e1f8ca1c0e3d7f697d0c4cd1bf.tar.gz
rails-47bdf3bf40ec17e1f8ca1c0e3d7f697d0c4cd1bf.tar.bz2
rails-47bdf3bf40ec17e1f8ca1c0e3d7f697d0c4cd1bf.zip
Ensure AutosaveAssociation runs remove callbacks [#2146 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/autosave_association.rb')
-rw-r--r--activerecord/lib/active_record/autosave_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index 6dcc5005d1..741aa2acbe 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -283,7 +283,7 @@ module ActiveRecord
if records = associated_records_to_validate_or_save(association, @new_record_before_save, autosave)
records.each do |record|
if autosave && record.marked_for_destruction?
- record.destroy
+ association.destroy(record)
elsif @new_record_before_save || record.new_record?
if autosave
association.send(:insert_record, record, false, false)