Read about our upcoming Code of Conduct on this issue

diff_discussion.rb 693 Bytes
Newer Older
Douwe Maan's avatar
Douwe Maan committed
1
# A discussion on merge request or commit diffs consisting of `DiffNote` notes.
2
3
#
# A discussion of this type can be resolvable.
4
class DiffDiscussion < Discussion
5
  include DiscussionOnDiff
6

7
8
9
10
  def self.note_class
    DiffNote
  end

11
12
  delegate  :position,
            :original_position,
13
            :change_position,
14
15
16
17
18
19
20

            to: :first_note

  def legacy_diff_discussion?
    false
  end

21
22
  def merge_request_version_params
    return unless for_merge_request?
23
    return {} if active?
24

25
    noteable.version_params_for(position.diff_refs)
26
27
  end

28
  def reply_attributes
29
30
    super.merge(
      original_position: original_position.to_json,
31
      position: position.to_json
32
    )
33
34
  end
end