summaryrefslogtreecommitdiff
path: root/app/finders/projects_finder.rb
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-08-12 14:29:59 +0200
committerAhmad Sherif <me@ahmadsherif.com>2016-08-15 12:49:31 +0200
commitd13c36f72de6b1c56e2063dafddd14ecbb430b9a (patch)
tree30d3b95fcfeb7ed6dd2a5c8895997376316b929e /app/finders/projects_finder.rb
parenta632ed69739c672da8fafff2fe64f37a9c3e4405 (diff)
downloadgitlab-ce-d13c36f72de6b1c56e2063dafddd14ecbb430b9a.tar.gz
Speed up todos queries by limiting the projects set we join with
Closes #20828
Diffstat (limited to 'app/finders/projects_finder.rb')
-rw-r--r--app/finders/projects_finder.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb
index 2f0a9659d15..56877b6d75a 100644
--- a/app/finders/projects_finder.rb
+++ b/app/finders/projects_finder.rb
@@ -1,6 +1,7 @@
class ProjectsFinder < UnionFinder
- def execute(current_user = nil, options = {})
+ def execute(current_user = nil, options = {}, &block)
segments = all_projects(current_user)
+ segments.map!(&block) if block
find_union(segments, Project)
end