debian-mirror-gitlab/app/controllers/concerns/renders_projects_list.rb

15 lines
397 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
module RendersProjectsList
def prepare_projects_for_rendering(projects)
preload_max_member_access_for_collection(Project, projects)
2021-11-11 11:23:49 +05:30
# Call the count methods on every project, so the BatchLoader would load them all at
2020-07-28 23:09:34 +05:30
# once when the entities are rendered
projects.each(&:forks_count)
2021-11-11 11:23:49 +05:30
projects.each(&:open_issues_count)
2020-07-28 23:09:34 +05:30
projects
end
end