summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2016-05-30 10:59:14 -0700
committerDJ Mountney <david@twkie.net>2016-06-02 11:24:18 -0700
commit4280575fc0888632196cf4483dcd777618c13390 (patch)
treec3910d26ece7f9a0c8f801b272242821f547cac6 /app/finders
parent4ecc10fade61a1b45cd45ea4189e95a2acbea353 (diff)
downloadgitlab-ce-4280575fc0888632196cf4483dcd777618c13390.tar.gz
Move filtering todos by projects not pending deletion into a scope on the todo model
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/todos_finder.rb8
1 files changed, 1 insertions, 7 deletions
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)