提交 b0fc912f 编写于 作者: A Aaron Patterson

avoid deprecate api

上级 8c9b5e41
......@@ -271,7 +271,14 @@ def destroy(id)
# If you need to destroy dependent associations or call your <tt>before_*</tt> or
# +after_destroy+ callbacks, use the +destroy_all+ method instead.
def delete_all(conditions = nil)
conditions ? where(conditions).delete_all : arel.delete.tap { reset }
if conditions
where(conditions).delete_all
else
statement = arel.compile_delete
affected = @klass.connection.delete statement.to_sql
reset
affected
end
end
# Deletes the row with a primary key matching the +id+ argument, using a
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册