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

batch_open_issues_count_service.rb « projects « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a0d9120487c3400aadb03dbda80aa67c51a11cb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Projects
  # Service class for getting and caching the number of forks of several projects
  class BatchOpenIssuesCountService < Projects::BatchCountService
    def global_count
      @global_count ||= Issue.opened.public_only
                             .where(project: @projects.map(&:id))
                             .group(:project_id)
                             .count
    end

    def count_service
      ::Projects::OpenIssuesCountService
    end
  end
end