aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2016-01-31 00:33:54 +0530
committerVipul A M <vipulnsward@gmail.com>2016-01-31 00:36:23 +0530
commit6c54f6c746673915eeedbfb2907547189c1e37df (patch)
treefa2301b198b0c5f1f03e76b6cde3aacdfa4f3abc /activerecord/lib/active_record/persistence.rb
parent22261405a38dbab84c98925fb4cfbef700d400a4 (diff)
downloadrails-6c54f6c746673915eeedbfb2907547189c1e37df.tar.gz
rails-6c54f6c746673915eeedbfb2907547189c1e37df.tar.bz2
rails-6c54f6c746673915eeedbfb2907547189c1e37df.zip
- Updated persistence documentation to make it clear that save and save! won't update a record if validation fails.
- Also fixed `update` method's documention to be uniform about this statement. Fixes #20821 [ci skip] [Vipul A M & pseidemann ]
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 4d661735cc..d9a394fb71 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -106,7 +106,7 @@ module ActiveRecord
# the existing record gets updated.
#
# By default, save always runs validations. If any of them fail the action
- # is cancelled and #save returns +false+. However, if you supply
+ # is cancelled and #save returns +false+, and the record won't be saved. However, if you supply
# validate: false, validations are bypassed altogether. See
# ActiveRecord::Validations for more information.
#
@@ -133,7 +133,7 @@ module ActiveRecord
# the existing record gets updated.
#
# By default, #save! always runs validations. If any of them fail
- # ActiveRecord::RecordInvalid gets raised. However, if you supply
+ # ActiveRecord::RecordInvalid gets raised, and the record won't be saved. However, if you supply
# validate: false, validations are bypassed altogether. See
# ActiveRecord::Validations for more information.
#
@@ -270,7 +270,7 @@ module ActiveRecord
alias update_attributes update
# Updates its receiver just like #update but calls #save! instead
- # of +save+, so an exception is raised if the record is invalid.
+ # of +save+, so an exception is raised if the record is invalid and saving will fail.
def update!(attributes)
# The following transaction covers any possible database side-effects of the
# attributes assignment. For example, setting the IDs of a child collection.