debian-mirror-gitlab/app/controllers/concerns/renders_projects_list.rb
2023-05-27 22:25:52 +05:30

15 lines
444 B
Ruby

# 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.each(&:open_merge_requests_count)
projects
end
end