提交 176883a9 编写于 作者: A Aaron Patterson

rescue record invalid exceptions and return false from the save method. fixes #796

上级 559d8096
......@@ -33,7 +33,11 @@ def persisted?
# +save+ returns +false+. See ActiveRecord::Callbacks for further
# details.
def save(*)
create_or_update
begin
create_or_update
rescue ActiveRecord::RecordInvalid
false
end
end
# Saves the model.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册