From 80f61b4035607d7cd87de993b8f5e996bde3481f Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 18 Sep 2019 14:02:45 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/finders/todos_finder.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/finders/todos_finder.rb') 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 -- cgit v1.2.3