From 5573b2148469abc730a041a0e06c1afc68a2c5ca Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Mon, 30 Jan 2017 11:49:24 -0500 Subject: [PATCH] Docs: Specify return value of `save!` I can never remember if it returns `self` or `true` (seems to be `true`) [ci skip] --- activerecord/lib/active_record/persistence.rb | 2 ++ 1 file changed, 2 insertions(+) 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