Skip to content
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

make difference more clear between save and save! in doc #20821

Closed
wants to merge 1 commit into from
Closed

make difference more clear between save and save! in doc #20821

wants to merge 1 commit into from

Conversation

pseidemann
Copy link
Contributor

adapts changes proposed at https://groups.google.com/forum/#!topic/rubyonrails-core/Py9x8rLaxgQ.
related to #20662.

changes the documentation of save by adding "attempts" to the first paragraph and setting the paragraph about "validations can abort the action" as the second paragraph.

@zzak zzak added the docs label Jul 9, 2015
@repinel
Copy link
Member

repinel commented Jul 14, 2015

Wouldn't this leave the documentation for methods like update_attribute and update inconsistent?

In your point of view, they attempt to update, but something can happen and they'll return false.

@arthurnn
Copy link
Member

arthurnn commented Oct 4, 2015

Wouldn't this leave the documentation for methods like update_attribute and update inconsistent?

yes.

Maybe we should change this part instead:

-     # By default, save always run validations. If any of them fail the action
-     # is cancelled and +save+ returns +false+.
+     # By default, save always run validations. If any of them fail the action
+     # is cancelled and +save+ returns +false+ and the record wont be saved.

vipulnsward added a commit to vipulnsward/rails that referenced this pull request Jan 30, 2016
…ve! won't update a record if validation fails.

- Also fixed `update` method's documention to be uniform about this statement.
Fixes rails#20821

[ci skip]

[Vipul A M & pseidemann ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants