diff options
author | mhasbini <mohammad.hasbini@gmail.com> | 2017-04-02 20:48:58 +0300 |
---|---|---|
committer | mhasbini <mohammad.hasbini@gmail.com> | 2017-04-02 20:48:58 +0300 |
commit | 2332bf34ac417bb8a0aaba9482379bcfadb6d26e (patch) | |
tree | 5dfc88d99fa60499397337f9609642c03ebe4981 | |
parent | 9fc17f6f4abdb04f3cf1b60b87bd67b894a19c39 (diff) |
Remove unnecessary ORDER BY clause when updating todos
-rw-r--r-- | app/services/todo_service.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/todo-update-order.yml | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index 2c56cb4c680..b6e88b0280f 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -204,7 +204,7 @@ class TodoService # Only update those that are not really on that state todos = todos.where.not(state: state) todos_ids = todos.pluck(:id) - todos.update_all(state: state) + todos.unscope(:order).update_all(state: state) current_user.update_todos_count_cache todos_ids end diff --git a/changelogs/unreleased/todo-update-order.yml b/changelogs/unreleased/todo-update-order.yml new file mode 100644 index 00000000000..2046b6df11e --- /dev/null +++ b/changelogs/unreleased/todo-update-order.yml @@ -0,0 +1,4 @@ +--- +title: Remove unnecessary ORDER BY clause when updating todos +merge_request: +author: mhasbini |