diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-07 18:12:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-07 18:12:00 +0300 |
commit | c3524d16b2ef6a13fd6b398aaeae9af5462f1e33 (patch) | |
tree | e5f48d7b49599541526f09f8f0954b14a855f866 /app/models/user_highest_role.rb | |
parent | 43c3400c67f6470d4a19f143008990ee142dd828 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/user_highest_role.rb')
-rw-r--r-- | app/models/user_highest_role.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/user_highest_role.rb b/app/models/user_highest_role.rb index 4853fc3d248..dd5c85a5a87 100644 --- a/app/models/user_highest_role.rb +++ b/app/models/user_highest_role.rb @@ -3,7 +3,13 @@ class UserHighestRole < ApplicationRecord belongs_to :user, optional: false - validates :highest_access_level, allow_nil: true, inclusion: { in: Gitlab::Access.all_values } + validates :highest_access_level, allow_nil: true, inclusion: { in: ->(_) { self.allowed_values } } scope :with_highest_access_level, -> (highest_access_level) { where(highest_access_level: highest_access_level) } + + def self.allowed_values + Gitlab::Access.all_values + end end + +UserHighestRole.prepend_mod |