提交 6c997c3c 编写于 作者: P Pratik Naik

Simplify Model.delete_all

上级 c5f3811a
......@@ -937,7 +937,7 @@ def destroy_all(conditions = nil)
# Both calls delete the affected posts all at once with a single DELETE statement. 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)
active_relation.where(construct_conditions(conditions, current_scoped_methods)).delete_all
where(conditions).delete_all
end
# Returns the result of an SQL statement that should only include a COUNT(*) in the SELECT part.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册