debian-mirror-gitlab/app/models/legacy_diff_discussion.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
949 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
# A discussion on merge request or commit diffs consisting of `LegacyDiffNote` notes.
#
# All new diff discussions are of the type `DiffDiscussion`, but any diff discussions created
# before the introduction of the new implementation still use `LegacyDiffDiscussion`.
#
# A discussion of this type is never resolvable.
class LegacyDiffDiscussion < Discussion
include DiscussionOnDiff
memoized_values << :active
def self.note_class
LegacyDiffNote
end
def legacy_diff_discussion?
true
end
2018-03-17 18:26:18 +05:30
def on_image?
false
end
def on_text?
true
end
2023-04-23 21:23:45 +05:30
def active?(...)
2017-08-17 22:00:37 +05:30
return @active if @active.present?
2023-04-23 21:23:45 +05:30
@active = first_note.active?(...)
2017-08-17 22:00:37 +05:30
end
def collapsed?
!active?
end
def merge_request_version_params
return unless for_merge_request?
if active?
{}
else
nil
end
end
def reply_attributes
super.merge(line_code: line_code)
end
end