From 4280575fc0888632196cf4483dcd777618c13390 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Mon, 30 May 2016 10:59:14 -0700 Subject: Move filtering todos by projects not pending deletion into a scope on the todo model --- app/finders/todos_finder.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'app/finders') diff --git a/app/finders/todos_finder.rb b/app/finders/todos_finder.rb index 3243d62fc95..5d7d55180e1 100644 --- a/app/finders/todos_finder.rb +++ b/app/finders/todos_finder.rb @@ -23,13 +23,7 @@ class TodosFinder end def execute - items = current_user.todos - - # Filter out todos linked to project pending deletion - items = items.joins( - 'INNER JOIN projects ON projects.id = todos.project_id AND projects.pending_delete = false' - ) - + items = current_user.todos.not_pending_delete items = by_action_id(items) items = by_author(items) items = by_project(items) -- cgit v1.2.1