mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
53737eadd6
commit
b8ff69fcdd
1 changed files with 2 additions and 2 deletions
|
@ -1765,8 +1765,8 @@ module ActiveRecord #:nodoc:
|
||||||
private
|
private
|
||||||
def create_or_update
|
def create_or_update
|
||||||
raise ReadOnlyRecord if readonly?
|
raise ReadOnlyRecord if readonly?
|
||||||
if new_record? then create else update end
|
result = new_record? ? create : update
|
||||||
true
|
result != false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates the associated record with values matching those of the instance attributes.
|
# Updates the associated record with values matching those of the instance attributes.
|
||||||
|
|
Loading…
Reference in a new issue