From c61bb08d0e95530086570bd1e2e874e36d6fb711 Mon Sep 17 00:00:00 2001 From: Rob Olson Date: Fri, 18 Sep 2009 13:51:02 -0700 Subject: NestedAttributes: call reload after saving to see deletions reflected in nested associations. Docs now match actual behavior. --- activerecord/lib/active_record/nested_attributes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index bc4cca7855..de48b10c1c 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -72,7 +72,7 @@ module ActiveRecord # member.avatar_attributes = { :id => '2', :_delete => '1' } # member.avatar.marked_for_destruction? # => true # member.save - # member.avatar #=> nil + # member.reload.avatar #=> nil # # Note that the model will _not_ be destroyed until the parent is saved. # @@ -160,7 +160,7 @@ module ActiveRecord # member.posts.detect { |p| p.id == 2 }.marked_for_destruction? # => true # member.posts.length #=> 2 # member.save - # member.posts.length # => 1 + # member.reload.posts.length # => 1 # # === Saving # -- cgit v1.2.3