You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
324 B
11 lines
324 B
# frozen_string_literal: true
|
|
|
|
class User < ApplicationRecord
|
|
ROLES = { user: 0, project: 10, data: 20, admin: 100 }.freeze
|
|
enum role: ROLES
|
|
|
|
validates :email, presence: true
|
|
validates :first_name, presence: true
|
|
validates :last_name, presence: true
|
|
validates :role, presence: true, inclusion: { in: ROLES }
|
|
end
|
|
|