diff options
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') |