Commit 2332bf34 authored by mhasbini's avatar mhasbini

Remove unnecessary ORDER BY clause when updating todos

parent 9fc17f6f
...@@ -204,7 +204,7 @@ class TodoService ...@@ -204,7 +204,7 @@ class TodoService
# Only update those that are not really on that state # Only update those that are not really on that state
todos = todos.where.not(state: state) todos = todos.where.not(state: state)
todos_ids = todos.pluck(:id) todos_ids = todos.pluck(:id)
todos.update_all(state: state) todos.unscope(:order).update_all(state: state)
current_user.update_todos_count_cache current_user.update_todos_count_cache
todos_ids todos_ids
end end
......
---
title: Remove unnecessary ORDER BY clause when updating todos
merge_request:
author: mhasbini
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment