summaryrefslogtreecommitdiff
path: root/app/models/individual_note_discussion.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/individual_note_discussion.rb')
-rw-r--r--app/models/individual_note_discussion.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/individual_note_discussion.rb b/app/models/individual_note_discussion.rb
index 07ee7470ea2..aab0ff93468 100644
--- a/app/models/individual_note_discussion.rb
+++ b/app/models/individual_note_discussion.rb
@@ -13,6 +13,14 @@ class IndividualNoteDiscussion < Discussion
true
end
+ def can_convert_to_discussion?
+ noteable.supports_replying_to_individual_notes? && Feature.enabled?(:reply_to_individual_notes)
+ end
+
+ def convert_to_discussion!
+ first_note.becomes!(Discussion.note_class).to_discussion
+ end
+
def reply_attributes
super.tap { |attrs| attrs.delete(:discussion_id) }
end