diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 17:02:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 17:02:45 +0300 |
commit | 80f61b4035607d7cd87de993b8f5e996bde3481f (patch) | |
tree | 06b12f51e97d87192e3dd0e05edf55143645b894 /app/finders/todos_finder.rb | |
parent | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders/todos_finder.rb')
-rw-r--r-- | app/finders/todos_finder.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/finders/todos_finder.rb b/app/finders/todos_finder.rb index ed6d20b9585..427fd3e7d85 100644 --- a/app/finders/todos_finder.rb +++ b/app/finders/todos_finder.rb @@ -47,11 +47,12 @@ class TodosFinder sort(items) end - # Returns `true` if the current user has any todos for the given target. + # Returns `true` if the current user has any todos for the given target with the optional given state. # # target - The value of the `target_type` column, such as `Issue`. - def any_for_target?(target) - current_user.todos.any_for_target?(target) + # state - The value of the `state` column, such as `pending` or `done`. + def any_for_target?(target, state = nil) + current_user.todos.any_for_target?(target, state) end private |