diff options
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 |