Class: LegacyDiffDiscussion
- Inherits:
-
Discussion
- Object
- Discussion
- LegacyDiffDiscussion
- Includes:
- DiscussionOnDiff
- Defined in:
- app/models/legacy_diff_discussion.rb
Overview
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.
Constant Summary
Constants included from DiscussionOnDiff
DiscussionOnDiff::NUMBER_OF_TRUNCATED_DIFF_LINES, DiscussionOnDiff::TruncatedDiffLinesError
Constants inherited from Discussion
Instance Attribute Summary
Attributes inherited from Discussion
Class Method Summary collapse
Instance Method Summary collapse
- #active? ⇒ Boolean
- #collapsed? ⇒ Boolean
- #legacy_diff_discussion? ⇒ Boolean
- #merge_request_version_params ⇒ Object
- #on_image? ⇒ Boolean
- #on_text? ⇒ Boolean
- #reply_attributes ⇒ Object
Methods included from DiscussionOnDiff
#diff_discussion?, #diff_file, #file_new_path, #line_code_in_diffs, #on_merge_request_commit?, #truncated_diff_lines
Methods inherited from Discussion
#==, base_discussion_id, build, build_collection, build_discussion_id, build_discussions, #cache_key, #can_convert_to_discussion?, #declarative_policy_delegate, #diff_discussion?, #discussion_class, discussion_id, #expanded?, #id, #individual_note?, #initialize, #last_note, #last_updated_at, #last_updated_by, lazy_find, model_class, #noteable_collection_name, override_discussion_id, #project_id, #reply_id, #to_global_id, #updated?
Methods included from ResolvableDiscussion
#can_resolve?, #clear_memoized_values, #first_note, #first_note_to_resolve, #last_resolved_note, #resolvable?, #resolve!, #resolved?, #resolved_by_push?, #resolved_notes, #to_be_resolved?, #unresolve!
Constructor Details
This class inherits a constructor from Discussion
Class Method Details
.note_class ⇒ Object
14 15 16 |
# File 'app/models/legacy_diff_discussion.rb', line 14 def self.note_class LegacyDiffNote end |
Instance Method Details
#active? ⇒ Boolean
30 31 32 33 34 |
# File 'app/models/legacy_diff_discussion.rb', line 30 def active?(...) return @active if @active.present? @active = first_note.active?(...) end |
#collapsed? ⇒ Boolean
36 37 38 |
# File 'app/models/legacy_diff_discussion.rb', line 36 def collapsed? !active? end |
#legacy_diff_discussion? ⇒ Boolean
18 19 20 |
# File 'app/models/legacy_diff_discussion.rb', line 18 def legacy_diff_discussion? true end |
#merge_request_version_params ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'app/models/legacy_diff_discussion.rb', line 40 def merge_request_version_params return unless for_merge_request? if active? {} else nil end end |
#on_image? ⇒ Boolean
22 23 24 |
# File 'app/models/legacy_diff_discussion.rb', line 22 def on_image? false end |
#on_text? ⇒ Boolean
26 27 28 |
# File 'app/models/legacy_diff_discussion.rb', line 26 def on_text? true end |
#reply_attributes ⇒ Object
50 51 52 |
# File 'app/models/legacy_diff_discussion.rb', line 50 def reply_attributes super.merge(line_code: line_code) end |