aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJared Beck <jared@jaredbeck.com>2017-01-30 11:49:24 -0500
committerGitHub <noreply@github.com>2017-01-30 11:49:24 -0500
commit5573b2148469abc730a041a0e06c1afc68a2c5ca (patch)
tree72890ca6b497e0cd4ba42fd56f85323f97079899 /activerecord
parent6bf6957137842015c8dff1a2f39a23aec54f41c6 (diff)
downloadrails-5573b2148469abc730a041a0e06c1afc68a2c5ca.tar.gz
rails-5573b2148469abc730a041a0e06c1afc68a2c5ca.tar.bz2
rails-5573b2148469abc730a041a0e06c1afc68a2c5ca.zip
Docs: Specify return value of `save!`
I can never remember if it returns `self` or `true` (seems to be `true`) [ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/persistence.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 4cd867faae..7ceb7d1a55 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -148,6 +148,8 @@ module ActiveRecord
#
# Attributes marked as readonly are silently ignored if the record is
# being updated.
+ #
+ # Unless an error is raised, returns true.
def save!(*args)
create_or_update(*args) || raise(RecordNotSaved.new("Failed to save the record", self))
end