diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 15:12:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 15:12:20 +0300 |
commit | 73507eaf1a77c5c05ae17c9f7ac29bbeb8bf5be1 (patch) | |
tree | 7f9b8b4246b9d0ce354866b07f4e9f657ac9665d /app/serializers | |
parent | 86ace8a66caeb11a2912e15e8a9abc3d9e4960c2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/merge_request_user_entity.rb | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/app/serializers/merge_request_user_entity.rb b/app/serializers/merge_request_user_entity.rb index 2e875af6531..36825d14062 100644 --- a/app/serializers/merge_request_user_entity.rb +++ b/app/serializers/merge_request_user_entity.rb @@ -17,7 +17,7 @@ class MergeRequestUserEntity < ::API::Entities::UserBasic end expose :reviewed, if: satisfies(:present?, :allows_reviewers?) do |user, options| - find_reviewer_or_assignee(user, options)&.reviewed? + options[:merge_request].find_reviewer(user)&.reviewed? end expose :approved, if: satisfies(:present?) do |user, options| @@ -25,16 +25,6 @@ class MergeRequestUserEntity < ::API::Entities::UserBasic # makes one query per merge request, whereas #approved_by? makes one per user options[:merge_request].approvals.any? { |app| app.user_id == user.id } end - - private - - def find_reviewer_or_assignee(user, options) - if options[:type] == :reviewers - options[:merge_request].find_reviewer(user) - else - options[:merge_request].find_assignee(user) - end - end end MergeRequestUserEntity.prepend_mod_with('MergeRequestUserEntity') |