提交 45545643 编写于 作者: R Ryuta Kamizono

Simply use `scope.delete_all` instead of constructing delete manager

上级 12237825
......@@ -147,14 +147,7 @@ def delete_records(records, method)
count = scope.destroy_all.length
else
scope.each(&:_run_destroy_callbacks)
arel = scope.arel
stmt = Arel::DeleteManager.new
stmt.from scope.klass.arel_table
stmt.wheres = arel.constraints
count = scope.klass.connection.delete(stmt, "SQL")
count = scope.delete_all
end
when :nullify
count = scope.update_all(source_reflection.foreign_key => nil)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册