update_only documentation for accepts_nested_attributes_for #5212

merged 1 commit into from Feb 28, 2012


None yet
2 participants

MarkMT commented Feb 28, 2012

I found the existing API documentation for the update_only option confusing and had to spend a lot of time studying the code to understand what it actually does. For example, when the existing comments say that update_only "allows you to specify that an existing record may only be updated", it's not clear what this is being contrasted with. Here's an example blog post that illustrates someone else's confusion on exactly this point (see the second to last paragraph).

To understand the current description you also need to know (a) that the alternative to updating the record that the comment alludes to is to replace it with a new one, and (b) that in the default case the record is updated only if you supply a matching id, and replaced with a new one if you don't - again not something that is necessarily obvious.

The changes I have made are intended to address these points.

@fxn fxn added a commit that referenced this pull request Feb 28, 2012

@fxn fxn Merge pull request #5212 from MarkMT/master
update_only documentation for accepts_nested_attributes_for

@fxn fxn merged commit 7d29d7a into rails:master Feb 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment