diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 21:06:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 21:06:49 +0300 |
commit | ab7cf450ba19cf80b9534f25dc707b33845e3014 (patch) | |
tree | bbfa6aba83c48aea68d79c4179ce576b6eec326d /app/services/todo_service.rb | |
parent | 4204cf308596e0e26f578a6e2da88f49c0f4aad9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/todo_service.rb')
-rw-r--r-- | app/services/todo_service.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index e7bcca1a38d..55f888d5664 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -179,6 +179,14 @@ class TodoService mark_todos_as_done(todos, current_user) end + def mark_todo_as_done(todo, current_user) + return if todo.done? + + todo.update(state: :done) + + current_user.update_todos_count_cache + end + # When user marks some todos as pending def mark_todos_as_pending(todos, current_user) update_todos_state(todos, current_user, :pending) |