summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-08-12 17:38:09 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-08-25 06:46:11 +0200
commit7629dc9982f5559972acf9d9b9d98f78ad53e54c (patch)
treeabbdeccb7afb5b0a86c7e199253c3eceb63bd1a8 /app
parent6fb46b604e4feebcbaa92d3d44d7616be709c0e5 (diff)
downloadgitlab-ce-7629dc9982f5559972acf9d9b9d98f78ad53e54c.tar.gz
Add specs to ensure a successful return 19730-mark-as-done
on the UI when mark as done a already done todo.
Diffstat (limited to 'app')
-rw-r--r--app/services/todo_service.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb
index e0ccb654590..2aab8c736d6 100644
--- a/app/services/todo_service.rb
+++ b/app/services/todo_service.rb
@@ -148,7 +148,8 @@ class TodoService
def mark_todos_as_done_by_ids(ids, current_user)
todos = current_user.todos.where(id: ids)
- marked_todos = todos.update_all(state: :done)
+ # Only return those that are not really on that state
+ marked_todos = todos.where.not(state: :done).update_all(state: :done)
current_user.update_todos_count_cache
marked_todos
end