gitlab-org--gitlab-foss/app/views/shared/_new_project_item_select.html.haml
Yorick Peterse f77fda6437
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.
2017-08-07 12:38:27 +02:00

6 lines
421 B
Text

- if any_projects?(@projects)
.project-item-select-holder
= project_select_tag :project_path, class: "project-item-select", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at', relative_path: local_assigns[:path] }, with_feature_enabled: local_assigns[:with_feature_enabled]
%a.btn.btn-new.new-project-item-select-button
= local_assigns[:label]
= icon('caret-down')