Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/models/discussion.rb
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/models/discussion.rb')
-rw-r--r--app/models/discussion.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/discussion.rb b/app/models/discussion.rb
index 9eb3308b901..83c85f30178 100644
--- a/app/models/discussion.rb
+++ b/app/models/discussion.rb
@@ -10,7 +10,8 @@ class Discussion
# Bump this if we need to refresh the cached versions of discussions
CACHE_VERSION = 1
- attr_reader :notes, :context_noteable
+ attr_reader :context_noteable
+ attr_accessor :notes
delegate :created_at,
:project,
@@ -183,4 +184,11 @@ class Discussion
resolved_at
].join(':')
end
+
+ # Consolidate discussions GID. There is no need to have different GID for different class names as the discussion_id
+ # hash is already unique per discussion. This also fixes the issue where same discussion may return different GIDs
+ # depending on number of notes it has.
+ def to_global_id(options = {})
+ GlobalID.new(::Gitlab::GlobalId.build(model_name: Discussion.to_s, id: id))
+ end
end