No need to look up the notable separately in the ResolveService
The merge request will now always be there when the discussion was resolved by creating a new issue.
This commit is contained in:
parent
dcec4c531f
commit
224c2addde
2 changed files with 2 additions and 8 deletions
|
@ -9,13 +9,7 @@ module Discussions
|
|||
|
||||
discussion.resolve!(current_user)
|
||||
|
||||
notify_discussion_resolved(discussion)
|
||||
end
|
||||
|
||||
def notify_discussion_resolved(discussion)
|
||||
noteable = merge_request || discussion.noteable
|
||||
|
||||
MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(noteable)
|
||||
MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(merge_request)
|
||||
SystemNoteService.discussion_continued_in_issue(discussion, project, current_user, follow_up_issue) if follow_up_issue
|
||||
end
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ describe Discussions::ResolveService do
|
|||
let(:project) { merge_request.project }
|
||||
let(:merge_request) { discussion.noteable }
|
||||
let(:user) { create(:user) }
|
||||
let(:service) { described_class.new(discussion.noteable.project, user) }
|
||||
let(:service) { described_class.new(discussion.noteable.project, user, merge_request: merge_request) }
|
||||
|
||||
before do
|
||||
project.team << [user, :master]
|
||||
|
|
Loading…
Reference in a new issue