diff options
Diffstat (limited to 'app/finders/todos_finder.rb')
-rw-r--r-- | app/finders/todos_finder.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/finders/todos_finder.rb b/app/finders/todos_finder.rb index 2932e558a37..2b46e51290f 100644 --- a/app/finders/todos_finder.rb +++ b/app/finders/todos_finder.rb @@ -33,6 +33,8 @@ class TodosFinder end def execute + return Todo.none if current_user.nil? + items = current_user.todos items = by_action_id(items) items = by_action(items) @@ -180,11 +182,9 @@ class TodosFinder end def by_group(items) - if group? - items.for_group_and_descendants(group) - else - items - end + return items unless group? + + items.for_group_ids_and_descendants(params[:group_id]) end def by_state(items) |