blob: c3ccf44d27ef5f2af09d3fcfb3976599fadd92d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# frozen_string_literal: true
# A discussion to wrap a single `Note` note on the root of an issue, merge request,
# commit, or snippet, that is not displayed as a discussion.
#
# A discussion of this type is never resolvable.
class IndividualNoteDiscussion < Discussion
def self.note_class
Note
end
def individual_note?
true
end
def can_convert_to_discussion?
noteable.supports_replying_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
end
|