diff options
author | Jamis Buck <jamis@37signals.com> | 2006-10-04 15:43:31 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2006-10-04 15:43:31 +0000 |
commit | b8ff69fcddc06154b5ad0ee33e90a63bd966fa4a (patch) | |
tree | 39c3f3aeac0d1d32f46efa12b7352243a1e242d5 /activerecord | |
parent | 53737eadd6ee69b81f50029908502fa43dc9fe95 (diff) | |
download | rails-b8ff69fcddc06154b5ad0ee33e90a63bd966fa4a.tar.gz rails-b8ff69fcddc06154b5ad0ee33e90a63bd966fa4a.tar.bz2 rails-b8ff69fcddc06154b5ad0ee33e90a63bd966fa4a.zip |
callbacks that return false should cause save to return false
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index af2645eeb7..5d7c30caf9 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1765,8 +1765,8 @@ module ActiveRecord #:nodoc: private def create_or_update raise ReadOnlyRecord if readonly? - if new_record? then create else update end - true + result = new_record? ? create : update + result != false end # Updates the associated record with values matching those of the instance attributes. |