X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/11cc4a5e601dd288d601e6e35a72d159062f18b5..a01fbed6d9aed1a9bcd009b75190995d54eb8e13:/app/models/user_role.rb?ds=sidebyside diff --git a/app/models/user_role.rb b/app/models/user_role.rb index f3d48cade..332848e42 100644 --- a/app/models/user_role.rb +++ b/app/models/user_role.rb @@ -19,11 +19,11 @@ # user_roles_user_id_fkey (user_id => users.id) # -class UserRole < ActiveRecord::Base +class UserRole < ApplicationRecord belongs_to :user belongs_to :granter, :class_name => "User" - ALL_ROLES = %w[administrator moderator].freeze + ALL_ROLES = %w[administrator moderator importer].freeze validates :role, :inclusion => ALL_ROLES, :uniqueness => { :scope => :user_id } end