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:
authorYorick Peterse <yorickpeterse@gmail.com>2017-08-04 16:40:33 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2017-08-07 13:38:27 +0300
commitf77fda6437bfeb946510abdf5c56872af392f624 (patch)
tree247834fbb53527e37e8948c1bf001f3c69d0307a /app/views/shared/projects/_list.html.haml
parent81933cfdd3e23d24ae18c0d2f5452ecd9690ab63 (diff)
Improve checking if projects would be returned
In various places we check if the same relation would return projects. This is done using "any?" which will run a COUNT query with any LIMIT/OFFSET values still applied. To work around all this we introduce 2 helper methods that take care of doing the right thing. This leads to the produced queries being simpler and fewer queries being executed.
Diffstat (limited to 'app/views/shared/projects/_list.html.haml')
-rw-r--r--app/views/shared/projects/_list.html.haml2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml
index 7ed6c622558..66783fac6b2 100644
--- a/app/views/shared/projects/_list.html.haml
+++ b/app/views/shared/projects/_list.html.haml
@@ -10,7 +10,7 @@
- load_pipeline_status(projects)
.js-projects-list-holder
- - if projects.any?
+ - if any_projects?(projects)
%ul.projects-list
- projects.each_with_index do |project, i|
- css_class = (i >= projects_limit) || project.pending_delete? ? 'hide' : nil