2017-08-17 11:21:25 -04:00
|
|
|
module Projects
|
|
|
|
# Service class for counting and caching the number of open issues of a
|
|
|
|
# project.
|
2017-11-15 09:47:10 -05:00
|
|
|
class OpenIssuesCountService < Projects::CountService
|
2017-08-17 11:21:25 -04:00
|
|
|
def cache_key_name
|
|
|
|
'open_issues_count'
|
|
|
|
end
|
2017-11-30 06:52:38 -05:00
|
|
|
|
|
|
|
def self.query(project_ids)
|
|
|
|
# We don't include confidential issues in this number since this would
|
|
|
|
# expose the number of confidential issues to non project members.
|
|
|
|
Issue.opened.public_only.where(project: project_ids)
|
|
|
|
end
|
2017-08-17 11:21:25 -04:00
|
|
|
end
|
|
|
|
end
|