Commit 19f74903 authored by Marc Schwede's avatar Marc Schwede
parent a986241e
......@@ -51,7 +51,7 @@ class TodosFinder
#
# target - The value of the `target_type` column, such as `Issue`.
# state - The value of the `state` column, such as `pending` or `done`.
def any_for_target?(target, *state)
def any_for_target?(target, state = nil)
current_user.todos.any_for_target?(target, state)
end
......
......@@ -93,8 +93,8 @@ class Todo < ApplicationRecord
#
# target - The value of the `target_type` column, such as `Issue`.
# state - The value of the `state` column, such as `pending` or `done`.
def any_for_target?(target, *state)
state.empty? ? exists?(target: target) : exists?(target: target, state: state)
def any_for_target?(target, state = nil)
state.nil? ? exists?(target: target) : exists?(target: target, state: state)
end
# Updates the state of a relation of todos to the new state.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment