Fix MR note discussion ID

This commit is contained in:
Douwe Maan 2016-08-18 17:27:41 -05:00
parent ce8cb2f936
commit dc098fde96
1 changed files with 3 additions and 1 deletions

View File

@ -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