From 08bbb9fce66cb46d3262e6cd4c4379b59f065be0 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 9 Mar 2017 19:29:11 -0600 Subject: Add option to start a new discussion on an MR --- app/services/system_note_service.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'app/services/system_note_service.rb') diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 35cfcc3682e..c9e25c7aaa2 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -228,12 +228,10 @@ module SystemNoteService def discussion_continued_in_issue(discussion, project, author, issue) body = "created #{issue.to_reference} to continue this discussion" + note_attributes = discussion.reply_attributes.merge(project: project, author: author, note: body) - note_params = discussion.reply_attributes.merge(project: project, author: author, note: body) - note_params[:type] = note_params.delete(:note_type) - - note = Note.create(note_params.merge(system: true)) - note.system_note_metadata = SystemNoteMetadata.new({ action: 'discussion' }) + note = Note.create(note_attributes.merge(system: true)) + note.system_note_metadata = SystemNoteMetadata.new(action: 'discussion') note end -- cgit v1.2.3