diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-08-12 14:29:59 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-08-15 12:49:31 +0200 |
commit | d13c36f72de6b1c56e2063dafddd14ecbb430b9a (patch) | |
tree | 30d3b95fcfeb7ed6dd2a5c8895997376316b929e /app/finders/projects_finder.rb | |
parent | a632ed69739c672da8fafff2fe64f37a9c3e4405 (diff) | |
download | gitlab-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.rb | 3 |
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 |