aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/nested_attributes.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-17 03:26:20 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-17 03:26:20 +0530
commitdba196cb7f8d34b93f6872e4a43737bb52019065 (patch)
tree97a2f784a2ec2bfae4f960af56a9280dad6f7774 /activerecord/lib/active_record/nested_attributes.rb
parent6e3bee6cf1f0d2684152292db0a8b757249824fd (diff)
downloadrails-dba196cb7f8d34b93f6872e4a43737bb52019065.tar.gz
rails-dba196cb7f8d34b93f6872e4a43737bb52019065.tar.bz2
rails-dba196cb7f8d34b93f6872e4a43737bb52019065.zip
Merge docrails
Diffstat (limited to 'activerecord/lib/active_record/nested_attributes.rb')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index f79a12a95c..d8fae495e7 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -49,14 +49,14 @@ module ActiveRecord
# create the member and avatar in one go:
#
# params = { :member => { :name => 'Jack', :avatar_attributes => { :icon => 'smiling' } } }
- # member = Member.create(params)
+ # member = Member.create(params[:member])
# member.avatar.id # => 2
# member.avatar.icon # => 'smiling'
#
# It also allows you to update the avatar through the member:
#
- # params = { :member' => { :avatar_attributes => { :id => '2', :icon => 'sad' } } }
- # member.update_attributes params['member']
+ # params = { :member => { :avatar_attributes => { :id => '2', :icon => 'sad' } } }
+ # member.update_attributes params[:member]
# member.avatar.icon # => 'sad'
#
# By default you will only be able to set and update attributes on the
@@ -75,7 +75,7 @@ module ActiveRecord
# member.avatar_attributes = { :id => '2', :_destroy => '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.
#
@@ -179,7 +179,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
#