Commit 224c2add authored by Bob Van Landuyt's avatar Bob Van Landuyt

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.
parent dcec4c53
...@@ -9,13 +9,7 @@ module Discussions ...@@ -9,13 +9,7 @@ module Discussions
discussion.resolve!(current_user) discussion.resolve!(current_user)
notify_discussion_resolved(discussion) MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(merge_request)
end
def notify_discussion_resolved(discussion)
noteable = merge_request || discussion.noteable
MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(noteable)
SystemNoteService.discussion_continued_in_issue(discussion, project, current_user, follow_up_issue) if follow_up_issue SystemNoteService.discussion_continued_in_issue(discussion, project, current_user, follow_up_issue) if follow_up_issue
end end
......
...@@ -6,7 +6,7 @@ describe Discussions::ResolveService do ...@@ -6,7 +6,7 @@ describe Discussions::ResolveService do
let(:project) { merge_request.project } let(:project) { merge_request.project }
let(:merge_request) { discussion.noteable } let(:merge_request) { discussion.noteable }
let(:user) { create(:user) } 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 before do
project.team << [user, :master] project.team << [user, :master]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment