Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-08-12 15:29:59 +0300
committerAhmad Sherif <me@ahmadsherif.com>2016-08-15 13:49:31 +0300
commitd13c36f72de6b1c56e2063dafddd14ecbb430b9a (patch)
tree30d3b95fcfeb7ed6dd2a5c8895997376316b929e /app/finders/projects_finder.rb
parenta632ed69739c672da8fafff2fe64f37a9c3e4405 (diff)
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