summaryrefslogtreecommitdiff
path: root/app/services/projects/open_issues_count_service.rb
blob: 25de97325e2cc15818ef2c6a62ed31f6f753dcbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Projects
  # Service class for counting and caching the number of open issues of a
  # project.
  class OpenIssuesCountService < Projects::CountService
    def relation_for_count
      # We don't include confidential issues in this number since this would
      # expose the number of confidential issues to non project members.
      @project.issues.opened.public_only
    end

    def cache_key_name
      'open_issues_count'
    end
  end
end