summaryrefslogtreecommitdiff
path: root/app/models/legacy_diff_discussion.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-30 15:32:09 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-03 14:47:21 -0500
commitf8fabfcc6ff6be4e20e3cc9353be86b7cf53af47 (patch)
tree15816b09ecdebbd4eb797195b90cb4f46b6819c4 /app/models/legacy_diff_discussion.rb
parent185fd98fd4cb8f920558aea3795c4e1774cd39f5 (diff)
downloadgitlab-ce-f8fabfcc6ff6be4e20e3cc9353be86b7cf53af47.tar.gz
Allow commenting on older versions of the diff and comparisons between diff versionsdm-link-discussion-to-outdated-diff
Diffstat (limited to 'app/models/legacy_diff_discussion.rb')
-rw-r--r--app/models/legacy_diff_discussion.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/models/legacy_diff_discussion.rb b/app/models/legacy_diff_discussion.rb
index e617ce36f56..3c1d34db5fa 100644
--- a/app/models/legacy_diff_discussion.rb
+++ b/app/models/legacy_diff_discussion.rb
@@ -9,14 +9,14 @@ class LegacyDiffDiscussion < Discussion
memoized_values << :active
- def legacy_diff_discussion?
- true
- end
-
def self.note_class
LegacyDiffNote
end
+ def legacy_diff_discussion?
+ true
+ end
+
def active?(*args)
return @active if @active.present?
@@ -27,6 +27,16 @@ class LegacyDiffDiscussion < Discussion
!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