aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@gmail.com>2015-05-18 13:37:25 -0400
committerEileen M. Uchitelle <eileencodes@gmail.com>2015-05-18 13:37:25 -0400
commit0cae22d2ec42512bc496a2a344adc912ab9110d7 (patch)
treed98097fc836e9c5d13c981e8581937458ff23cb0 /activerecord
parentfcae2014ec09fa57448216a3edd70530b04a6510 (diff)
parent319baed48e5ddb6556bcb3a89914dabf87171995 (diff)
downloadrails-0cae22d2ec42512bc496a2a344adc912ab9110d7.tar.gz
rails-0cae22d2ec42512bc496a2a344adc912ab9110d7.tar.bz2
rails-0cae22d2ec42512bc496a2a344adc912ab9110d7.zip
Merge pull request #20082 from sh6khan/nested-attributes-docs
docs for updating nested attributes while creating parent record
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index 90e37e80d2..07e0f134aa 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -166,6 +166,11 @@ module ActiveRecord
# member.posts.first.title # => '[UPDATED] An, as of yet, undisclosed awesome Ruby documentation browser!'
# member.posts.second.title # => '[UPDATED] other post'
#
+ # However, the above applies if the parent model is being updated as well.
+ # For example, If you wanted to create a +member+ named _joe_ and wanted to
+ # update the +posts+ at the same time, that would give an
+ # ActiveRecord::RecordNotFound error.
+ #
# By default the associated records are protected from being destroyed. If
# you want to destroy any of the associated records through the attributes
# hash, you have to enable it first using the <tt>:allow_destroy</tt>