summaryrefslogtreecommitdiff
path: root/app/models/legacy_diff_discussion.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-30 18:38:21 -0600
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 17:44:14 +0100
commit2058e71e63c9ac471137f831b4d04b6626968532 (patch)
tree5c06529ab83a209f8ad7b203d1f131a97041b0bf /app/models/legacy_diff_discussion.rb
parent874413cf701870a0fc1051f7c0a5fc4b4f884657 (diff)
downloadgitlab-ce-2058e71e63c9ac471137f831b4d04b6626968532.tar.gz
Extract commonalities between DiffDiscussion and LegacyDiffDiscussion
Diffstat (limited to 'app/models/legacy_diff_discussion.rb')
-rw-r--r--app/models/legacy_diff_discussion.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/models/legacy_diff_discussion.rb b/app/models/legacy_diff_discussion.rb
index eb9766a9ffe..53fe9fbab06 100644
--- a/app/models/legacy_diff_discussion.rb
+++ b/app/models/legacy_diff_discussion.rb
@@ -1,10 +1,8 @@
-class LegacyDiffDiscussion < DiffDiscussion
- def self.unique_position_identifier(note)
- note.line_code
- end
+class LegacyDiffDiscussion < Discussion
+ include DiscussionOnDiff
- def self.build_original_discussion_id(note)
- Discussion.build_original_discussion_id(note)
+ def self.build_discussion_id(note)
+ [*super(note), note.line_code]
end
def legacy_diff_discussion?
@@ -19,4 +17,8 @@ class LegacyDiffDiscussion < DiffDiscussion
def collapsed?
!active?
end
+
+ def reply_attributes
+ super.merge(line_code: line_code)
+ end
end