summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-08-18 17:27:41 -0500
committerDouwe Maan <douwe@selenight.nl>2016-08-18 17:27:41 -0500
commitdc098fde969cc8f268ce495f1265e88dab10a88a (patch)
tree0dc59433310050551b6aa8dfb0c01db34dc457d3
parentce8cb2f93668407d5457defe023d77abb9a89b85 (diff)
downloadgitlab-ce-dc098fde969cc8f268ce495f1265e88dab10a88a.tar.gz
Fix MR note discussion ID
-rw-r--r--app/models/note.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index d01a0c4ce02..79f7a247fba 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -268,7 +268,9 @@ class Note < ActiveRecord::Base
def build_discussion_id
if for_merge_request?
- [:discussion, :note, id].join("-")
+ # Notes on merge requests are always in a discussion of their own,
+ # so we generate a unique discussion ID.
+ [:discussion, :note, SecureRandom.hex].join("-")
else
self.class.build_discussion_id(noteable_type, noteable_id || commit_id)
end