diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-08 15:35:04 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-08 15:35:04 +0300 |
commit | 40704daad839b7a9744b8d9c9ebc82e56ac452a1 (patch) | |
tree | b78dc964733b5626517be4a380e881d731ce10a2 /app/models/merge_request.rb | |
parent | 89a15bec5e1916af9e3ac254eb8777af4acddf68 (diff) | |
parent | bbbef273f74a59a18cf534e147e79e90888d7656 (diff) |
Merge branch 'restore-issues_mentioned_but_not_closing' into 'master'
pass in current_user in MergeRequest and MergeRequestsHelper
See merge request !8624
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 43085f69105..c0d4dd0197f 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -546,7 +546,7 @@ class MergeRequest < ActiveRecord::Base # Calculating this information for a number of merge requests requires # running `ReferenceExtractor` on each of them separately. # This optimization does not apply to issues from external sources. - def cache_merge_request_closes_issues!(current_user = self.author) + def cache_merge_request_closes_issues!(current_user) return if project.has_external_issue_tracker? transaction do @@ -558,10 +558,6 @@ class MergeRequest < ActiveRecord::Base end end - def closes_issue?(issue) - closes_issues.include?(issue) - end - # Return the set of issues that will be closed if this merge request is accepted. def closes_issues(current_user = self.author) if target_branch == project.default_branch @@ -575,13 +571,13 @@ class MergeRequest < ActiveRecord::Base end end - def issues_mentioned_but_not_closing(current_user = self.author) + def issues_mentioned_but_not_closing(current_user) return [] unless target_branch == project.default_branch ext = Gitlab::ReferenceExtractor.new(project, current_user) ext.analyze(description) - ext.issues - closes_issues + ext.issues - closes_issues(current_user) end def target_project_path |