diff options
author | Rob Olson <rob@thinkingdigitally.com> | 2009-09-18 13:51:02 -0700 |
---|---|---|
committer | Rob Olson <rob@thinkingdigitally.com> | 2009-09-18 13:51:02 -0700 |
commit | c61bb08d0e95530086570bd1e2e874e36d6fb711 (patch) | |
tree | 7f9c8fb0d7dd2aa63aa539420da1f03a77d49f61 /activerecord/lib/active_record | |
parent | 38e6eb74abdf379ceb02ae896c0f77a95d5664f4 (diff) | |
download | rails-c61bb08d0e95530086570bd1e2e874e36d6fb711.tar.gz rails-c61bb08d0e95530086570bd1e2e874e36d6fb711.tar.bz2 rails-c61bb08d0e95530086570bd1e2e874e36d6fb711.zip |
NestedAttributes: call reload after saving to see deletions reflected in
nested associations. Docs now match actual behavior.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/nested_attributes.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 # |