summaryrefslogtreecommitdiff
path: root/app/models/out_of_context_discussion.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-04 17:27:23 -0500
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 17:44:14 +0100
commitc319f2114177f011cd0c6c23b04f7c19971268bf (patch)
treeb91a2ace5426bea9a7c6a60eabbd44da394fa80c /app/models/out_of_context_discussion.rb
parentafa53810deab37c95da245510a7cf85e8846a162 (diff)
downloadgitlab-ce-c319f2114177f011cd0c6c23b04f7c19971268bf.tar.gz
Address review comments
Diffstat (limited to 'app/models/out_of_context_discussion.rb')
-rw-r--r--app/models/out_of_context_discussion.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/models/out_of_context_discussion.rb b/app/models/out_of_context_discussion.rb
index 7be9aa19707..62b62ea726c 100644
--- a/app/models/out_of_context_discussion.rb
+++ b/app/models/out_of_context_discussion.rb
@@ -1,13 +1,18 @@
-# A discussion to wrap a number of `Note` notes on the root of a commit when they
-# are displayed in context of a merge request as if they were part of a discussion.
+# When notes on a commit are displayed in the context of a merge request that contains that commit,
+# they are displayed as if they were a discussion.
+# This represents one of those discussions, consisting of `Note` notes.
class OutOfContextDiscussion < Discussion
- # To make sure all out-of-context notes are displayed in one discussion,
+ # Returns an array of discussion ID components
+ def self.build_discussion_id(note)
+ base_discussion_id(note)
+ end
+
+ # To make sure all out-of-context notes end up grouped as one discussion,
# we override the discussion ID to be a newly generated but consistent ID.
def self.override_discussion_id(note)
- Digest::SHA1.hexdigest(build_discussion_id_base(note).join("-"))
+ discussion_id(note)
end
- # Keep this method in sync with the `potentially_resolvable` scope on `ResolvableNote`
def potentially_resolvable?
false
end