debian-mirror-gitlab/app/models/user_highest_role.rb
2021-11-18 22:05:49 +05:30

15 lines
424 B
Ruby

# frozen_string_literal: true
class UserHighestRole < ApplicationRecord
belongs_to :user, optional: false
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