diff options
author | Francisco Lopez <fjlopez@gitlab.com> | 2017-11-30 14:52:38 +0300 |
---|---|---|
committer | Francisco Lopez <fjlopez@gitlab.com> | 2017-12-01 20:32:12 +0300 |
commit | 194f7bca9a286942bcd764c836180964e33a1e92 (patch) | |
tree | dd1612a1188dcc0fc9436d2c19de8227b661cc07 /app/services/projects/open_issues_count_service.rb | |
parent | 58c5b463ff75618a557d067c16f49ef581cda85c (diff) |
Comments from code review applied. Also switched forked_from_project and ForkedProjectLinks to ForkNetworkMember
Diffstat (limited to 'app/services/projects/open_issues_count_service.rb')
-rw-r--r-- | app/services/projects/open_issues_count_service.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/services/projects/open_issues_count_service.rb b/app/services/projects/open_issues_count_service.rb index 25de97325e2..ab1c477936a 100644 --- a/app/services/projects/open_issues_count_service.rb +++ b/app/services/projects/open_issues_count_service.rb @@ -3,13 +3,17 @@ module Projects # 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 + self.class.query(@project.id) end def cache_key_name 'open_issues_count' end + + 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 end end |