diff options
author | Jon Moss <maclover7@users.noreply.github.com> | 2016-02-23 20:38:47 -0500 |
---|---|---|
committer | Jon Moss <maclover7@users.noreply.github.com> | 2016-02-23 20:38:47 -0500 |
commit | 5ad9bcc3e5ed562d06ce6e4a0afac82ae26c1bbe (patch) | |
tree | b13588ff10e0fd34482c446f56a9ee05dbe11107 /activerecord/lib | |
parent | f6e5b6075f0b02400c066c0630822be8785742f3 (diff) | |
parent | 3e302bc61d08f0807a8160bf1420d1bdfeb74d42 (diff) | |
download | rails-5ad9bcc3e5ed562d06ce6e4a0afac82ae26c1bbe.tar.gz rails-5ad9bcc3e5ed562d06ce6e4a0afac82ae26c1bbe.tar.bz2 rails-5ad9bcc3e5ed562d06ce6e4a0afac82ae26c1bbe.zip |
Merge pull request #23840 from yui-knk/improve_the_readability_of_ar_doc
[ci skip] Improve the readability of documents of nested_attributes
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/nested_attributes.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 0d5a8e6f25..ae78ceee01 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -195,15 +195,23 @@ module ActiveRecord # Nested attributes for an associated collection can also be passed in # the form of a hash of hashes instead of an array of hashes: # - # Member.create(name: 'joe', - # posts_attributes: { first: { title: 'Foo' }, - # second: { title: 'Bar' } }) + # Member.create( + # name: 'joe', + # posts_attributes: { + # first: { title: 'Foo' }, + # second: { title: 'Bar' } + # } + # ) # # has the same effect as # - # Member.create(name: 'joe', - # posts_attributes: [ { title: 'Foo' }, - # { title: 'Bar' } ]) + # Member.create( + # name: 'joe', + # posts_attributes: [ + # { title: 'Foo' }, + # { title: 'Bar' } + # ] + # ) # # The keys of the hash which is the value for +:posts_attributes+ are # ignored in this case. |