diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/models/commit.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 8e7f526c512..6c8b4ae1139 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -3,6 +3,7 @@ class Commit extend ActiveModel::Naming extend Gitlab::Cache::RequestCache + extend Gitlab::Utils::Override include ActiveModel::Conversion include Noteable @@ -327,7 +328,7 @@ class Commit end def user_mentions - CommitUserMention.where(commit_id: self.id) + user_mention_class.where(commit_id: self.id) end def discussion_notes @@ -554,6 +555,19 @@ class Commit Ability.allowed?(user, :read_commit, self) end + override :user_mention_class + def user_mention_class + CommitUserMention + end + + override :user_mention_identifier + def user_mention_identifier + { + commit_id: id, + note_id: nil + } + end + private def expire_note_etag_cache_for_related_mrs |