提交 3b996535 编写于 作者: C Carlos Antonio da Silva

Remove not needed begin..end from AR#save

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