Welcome to mirror list, hosted at ThFree Co, Russian Federation.

renders_projects_list.rb « concerns « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 05bd9972ee76122c192555a92eaf673176cce961 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module RendersProjectsList
  def prepare_projects_for_rendering(projects)
    preload_max_member_access_for_collection(Project, projects)

    # Call the count methods on every project, so the BatchLoader would load them all at
    # once when the entities are rendered
    projects.each(&:forks_count)
    projects.each(&:open_issues_count)

    projects
  end
end