GitLab wird am Donnerstag, den 27. Januar, zwischen 08:00 und 12:00 Uhr wegen wichtigen Wartungsarbeiten nicht zur Verfügung stehen.

Commit 35ce7aae authored by Douwe Maan's avatar Douwe Maan
Browse files

Use sha1 of discussion ID.

parent aa267678
......@@ -57,7 +57,7 @@ def diff_view_line_data(line_code, position, line_type)
data.merge!(
note_type: LegacyDiffNote.name,
discussion_id: discussion_id
discussion_id: Digest::SHA1.hexdigest(discussion_id)
)
else
discussion_id = DiffNote.build_discussion_id(
......@@ -69,7 +69,7 @@ def diff_view_line_data(line_code, position, line_type)
data.merge!(
position: position.to_json,
note_type: DiffNote.name,
discussion_id: discussion_id
discussion_id: Digest::SHA1.hexdigest(discussion_id)
)
end
......
......@@ -34,11 +34,11 @@ def diff_attributes
end
def discussion_id
@discussion_id ||= self.class.build_discussion_id(noteable_type, noteable_id || commit_id, position)
@discussion_id ||= Digest::SHA1.hexdigest(self.class.build_discussion_id(noteable_type, noteable_id || commit_id, position))
end
def original_discussion_id
@original_discussion_id ||= self.class.build_discussion_id(noteable_type, noteable_id || commit_id, original_position)
@original_discussion_id ||= Digest::SHA1.hexdigest(self.class.build_discussion_id(noteable_type, noteable_id || commit_id, original_position))
end
def position=(new_position)
......
......@@ -22,7 +22,7 @@ def diff_attributes
end
def discussion_id
@discussion_id ||= self.class.build_discussion_id(noteable_type, noteable_id || commit_id, line_code)
@discussion_id ||= Digest::SHA1.hexdigest(self.class.build_discussion_id(noteable_type, noteable_id || commit_id, line_code))
end
def diff_file_hash
......
......@@ -145,9 +145,9 @@ def to_be_resolved?
def discussion_id
@discussion_id ||=
if for_merge_request?
[:discussion, :note, id].join("-")
Digest::SHA1.hexdigest([:discussion, :note, id].join("-"))
else
self.class.build_discussion_id(noteable_type, noteable_id || commit_id)
Digest::SHA1.hexdigest(self.class.build_discussion_id(noteable_type, noteable_id || commit_id))
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment