diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/models/discussion.rb | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (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.rb | 10 |
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 |