diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 15:21:10 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 15:21:10 +0000 |
| commit | e33f87ac0fabaab468ce4b457996cc0f1b1bb648 (patch) | |
| tree | 8bf0de72a9acac014cfdaddab7d463b208294af2 /app/controllers/explore | |
| parent | 5baf990db20a75078684702782c24399ef9eb0fa (diff) | |
| download | gitlab-ce-e33f87ac0fabaab468ce4b457996cc0f1b1bb648.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/explore')
| -rw-r--r-- | app/controllers/explore/projects_controller.rb | 17 |
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') |
