2018-07-17 16:50:37 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-01 10:34:24 +00:00
|
|
|
# Service class for getting and caching the number of issues of several projects
|
|
|
|
# Warning: do not user this service with a really large set of projects
|
|
|
|
# because the service use maps to retrieve the project ids
|
2017-11-24 12:20:52 +00:00
|
|
|
module Projects
|
|
|
|
class BatchOpenIssuesCountService < Projects::BatchCountService
|
|
|
|
def global_count
|
2017-11-30 11:52:38 +00:00
|
|
|
@global_count ||= begin
|
|
|
|
count_service.query(project_ids).group(:project_id).count
|
|
|
|
end
|
2017-11-24 12:20:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def count_service
|
|
|
|
::Projects::OpenIssuesCountService
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|