Commit d50caa64 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'remove-projects-finder-from-todos-finder' into 'master'

Don't use ProjectsFinder in TodosFinder

Closes #43767

See merge request gitlab-org/gitlab-ce!17462
parents 67feb7cd f09fe848
...@@ -110,10 +110,6 @@ class TodosFinder ...@@ -110,10 +110,6 @@ class TodosFinder
ids ids
end end
def projects(items)
ProjectsFinder.new(current_user: current_user, project_ids_relation: project_ids(items)).execute
end
def type? def type?
type.present? && %w(Issue MergeRequest).include?(type) type.present? && %w(Issue MergeRequest).include?(type)
end end
...@@ -152,13 +148,14 @@ class TodosFinder ...@@ -152,13 +148,14 @@ class TodosFinder
def by_project(items) def by_project(items)
if project? if project?
items = items.where(project: project) items.where(project: project)
else else
item_projects = projects(items) projects = Project
items = items.merge(item_projects).joins(:project) .public_or_visible_to_user(current_user)
end .order_id_desc
items items.joins(:project).merge(projects)
end
end end
def by_state(items) def by_state(items)
......
---
title: Don't use ProjectsFinder in TodosFinder
merge_request:
author:
type: performance
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