diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-05 01:27:23 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-05 19:44:14 +0300 |
commit | c319f2114177f011cd0c6c23b04f7c19971268bf (patch) | |
tree | b91a2ace5426bea9a7c6a60eabbd44da394fa80c /app/models/out_of_context_discussion.rb | |
parent | afa53810deab37c95da245510a7cf85e8846a162 (diff) |
Address review comments
Diffstat (limited to 'app/models/out_of_context_discussion.rb')
-rw-r--r-- | app/models/out_of_context_discussion.rb | 15 |
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 |