gitlab-org--gitlab-foss/app/models/project_authorization.rb

9 lines
303 B
Ruby
Raw Normal View History

class ProjectAuthorization < ActiveRecord::Base
belongs_to :user
belongs_to :project
validates :project, presence: true
validates :access_level, inclusion: { in: Gitlab::Access.all_values }, presence: true
validates :user, uniqueness: { scope: [:project, :access_level] }, presence: true
end