提交 8fc54a2e 编写于 作者: A Aaron Patterson

only take the limit if there is a limit to take

上级 2e60b007
......@@ -190,7 +190,7 @@ def update_all(updates, conditions = nil, options = {})
end
stmt = arel.compile_update(Arel.sql(@klass.send(:sanitize_sql_for_assignment, updates)))
stmt.take limit
stmt.take limit if limit
stmt.order(*order)
stmt.key = table[primary_key]
@klass.connection.update stmt.to_sql
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册