-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs for updating nested attributes while creating parent record #20082
Conversation
@@ -165,6 +165,9 @@ class TooManyRecords < ActiveRecordError | |||
# | |||
# member.posts.first.title # => '[UPDATED] An, as of yet, undisclosed awesome Ruby documentation browser!' | |||
# member.posts.second.title # => '[UPDATED] other post' | |||
# | |||
# However, this only 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 error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Can you note what that error is so users know they aren't hitting some other problem and assume it's this caveat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure !
796b908
to
6b57033
Compare
@eileencodes , are there any other changes that you recommend ? |
Yes, sorry I should have mentioned this before, can you wrap to 80 characters? Ping me when you've done that - github doesn't notify me on push, just on comments 😄 |
6b57033
to
319baed
Compare
thanks @eileencodes for the feedback, wrapped in 80 characters 😄 |
docs for updating nested attributes while creating parent record
@eileencodes Should we be using 80 character wrap for all docs and guides? The contributing guides don't appear to specify. Thanks! 😄 |
@trosborn when you write new docs or touch existing docs they should be 80 characters. PR's that just wrap existing the docs to 80 will be rejected because it's considered a cosmetic change. 😸 |
This references an issue that I had while trying to update a nested attribute while trying to create a new record in the parent model at the same time with
accepts_nested_attributes_for
.I think the reason that Rails doesn't allow this is because of a security issue, so I thought it would be good for every one else to know