diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-23 12:07:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-23 12:07:14 +0300 |
commit | cce3670f513baf1a7568ddb0593a827f6be9b8ab (patch) | |
tree | fc2cb27a3baaf8556112402889aa7d65d484631d /app/models/concerns | |
parent | c2839afed425662c306a419e52112af007f163eb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/noteable.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb index 492d55c74e2..36b134fdb65 100644 --- a/app/models/concerns/noteable.rb +++ b/app/models/concerns/noteable.rb @@ -205,6 +205,14 @@ module Noteable model_name.singular end + def commenters(user: nil) + eligable_notes = notes.user + + eligable_notes = eligable_notes.not_internal unless user&.can?(:read_internal_note, self) + + User.where(id: eligable_notes.select(:author_id).distinct) + end + private # Synthetic system notes don't have discussion IDs because these are generated dynamically |