From 9b57ad382e69044eb851f64cc0eb35896baa712a Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Tue, 30 Aug 2016 16:30:42 +0100 Subject: [PATCH] Move #to_discussion to NoteOnDiff --- app/models/concerns/note_on_diff.rb | 4 ++++ app/models/diff_note.rb | 4 ---- app/models/legacy_diff_note.rb | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/models/concerns/note_on_diff.rb b/app/models/concerns/note_on_diff.rb index a881fb83b7f..b8dd27a7afe 100644 --- a/app/models/concerns/note_on_diff.rb +++ b/app/models/concerns/note_on_diff.rb @@ -28,4 +28,8 @@ module NoteOnDiff def can_be_award_emoji? false end + + def to_discussion + Discussion.new([self]) + end end diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index c8320ff87fa..4442cefc7e9 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -107,10 +107,6 @@ class DiffNote < Note self.noteable.find_diff_discussion(self.discussion_id) end - def to_discussion - Discussion.new([self]) - end - private def supported? diff --git a/app/models/legacy_diff_note.rb b/app/models/legacy_diff_note.rb index 0e1649aafe5..40277a9b139 100644 --- a/app/models/legacy_diff_note.rb +++ b/app/models/legacy_diff_note.rb @@ -53,10 +53,6 @@ class LegacyDiffNote < Note self.line_code end - def to_discussion - Discussion.new([self]) - end - # Check if this note is part of an "active" discussion # # This will always return true for anything except MergeRequest noteables,