2017-08-17 22:00:37 +05:30
|
|
|
# A discussion on merge request or commit diffs consisting of `DiffNote` notes.
|
|
|
|
#
|
|
|
|
# A discussion of this type can be resolvable.
|
|
|
|
class DiffDiscussion < Discussion
|
|
|
|
include DiscussionOnDiff
|
|
|
|
|
|
|
|
def self.note_class
|
|
|
|
DiffNote
|
|
|
|
end
|
|
|
|
|
|
|
|
delegate :position,
|
|
|
|
:original_position,
|
2017-09-10 17:25:29 +05:30
|
|
|
:change_position,
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
to: :first_note
|
|
|
|
|
|
|
|
def legacy_diff_discussion?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def merge_request_version_params
|
|
|
|
return unless for_merge_request?
|
2017-09-10 17:25:29 +05:30
|
|
|
return {} if active?
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
noteable.version_params_for(position.diff_refs)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def reply_attributes
|
|
|
|
super.merge(
|
|
|
|
original_position: original_position.to_json,
|
2017-09-10 17:25:29 +05:30
|
|
|
position: position.to_json
|
2017-08-17 22:00:37 +05:30
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|