diff options
author | yui-knk <spiketeika@gmail.com> | 2016-02-24 10:24:14 +0900 |
---|---|---|
committer | yui-knk <spiketeika@gmail.com> | 2016-02-24 10:24:14 +0900 |
commit | 3e302bc61d08f0807a8160bf1420d1bdfeb74d42 (patch) | |
tree | c3f00e918adc74e667f7c84af91149065162af60 /activerecord/lib | |
parent | 42ad173d19a2220996ec4172d05681bde2e7320b (diff) | |
download | rails-3e302bc61d08f0807a8160bf1420d1bdfeb74d42.tar.gz rails-3e302bc61d08f0807a8160bf1420d1bdfeb74d42.tar.bz2 rails-3e302bc61d08f0807a8160bf1420d1bdfeb74d42.zip |
[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. |