From c42cd3c3834e13bd9eb0a444e0d6073aee548125 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Wed, 15 Mar 2006 02:32:14 +0000 Subject: make save! return true on success[johan@johansorensen.com]. Closes #4173 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3871 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 9e3c54c7d4..8c1f615a37 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1305,7 +1305,7 @@ module ActiveRecord #:nodoc: # Attempts to save the record, but instead of just returning false if it couldn't happen, it raises a # RecordNotSaved exception def save! - raise RecordNotSaved unless save + save || raise(RecordNotSaved) end # Deletes the record in the database and freezes this instance to reflect that no changes should -- cgit v1.2.3