summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorAlexandru Croitor <acroitor@gitlab.com>2019-06-12 19:28:25 +0300
committerAlexandru Croitor <acroitor@gitlab.com>2019-06-18 12:46:46 +0300
commit09163e423ac50c8eda82f67e5419142893faf18a (patch)
tree91f687ddb99fd03db7894c238759eea086029d51 /app/models/issue.rb
parente5ca7b8b0b5ba45f5847b6e545d17ca5af1cd929 (diff)
downloadgitlab-ce-09163e423ac50c8eda82f67e5419142893faf18a.tar.gz
Expose merge requests count based on user access
Count issues related merge requests based on user access level. And issue can have related MRs from projects where user does not have access so the number of related merge requests should be adjusted based on user's ability to access the related MRs. https://gitlab.com/gitlab-org/gitlab-ce/issues/59581
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 6da6fbe55cb..a330dea3940 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -250,8 +250,8 @@ class Issue < ApplicationRecord
end
# rubocop: enable CodeReuse/ServiceClass
- def merge_requests_count
- merge_requests_closing_issues.count
+ def merge_requests_count(user = nil)
+ ::MergeRequestsClosingIssues.count_for_issue(self.id, user)
end
private