diff options
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 |