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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 21:38:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 21:38:24 +0300
commit983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch)
treeb153cd387c14ba23bd5a07514c7c01fddf6a78a0 /app/controllers/explore
parenta2bddee2cdb38673df0e004d5b32d9f77797de64 (diff)
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'app/controllers/explore')
-rw-r--r--app/controllers/explore/projects_controller.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb
index a8a76b47bbe..705a586d614 100644
--- a/app/controllers/explore/projects_controller.rb
+++ b/app/controllers/explore/projects_controller.rb
@@ -66,18 +66,21 @@ class Explore::ProjectsController < Explore::ApplicationController
@total_starred_projects_count = ProjectsFinder.new(params: { starred: true }, current_user: current_user).execute
end
- # rubocop: disable CodeReuse/ActiveRecord
def load_projects
load_project_counts
- projects = ProjectsFinder.new(current_user: current_user, params: params)
- .execute
- .includes(:route, :creator, :group, namespace: [:route, :owner])
- .page(params[:page])
- .without_count
+ projects = ProjectsFinder.new(current_user: current_user, params: params).execute
+
+ projects = preload_associations(projects)
+ projects = projects.page(params[:page]).without_count
prepare_projects_for_rendering(projects)
end
+
+ # rubocop: disable CodeReuse/ActiveRecord
+ def preload_associations(projects)
+ projects.includes(:route, :creator, :group, namespace: [:route, :owner])
+ end
# rubocop: enable CodeReuse/ActiveRecord
def set_sorting
@@ -110,3 +113,5 @@ class Explore::ProjectsController < Explore::ApplicationController
end
end
end
+
+Explore::ProjectsController.prepend_if_ee('EE::Explore::ProjectsController')