summaryrefslogtreecommitdiff
path: root/app/models/user_account.rb
blob: ceb8334e06f3c3230429bd677242add7d84769d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

# UserAccount model
# email: string
# password_digest (secure password): string
# first_name: string
# last_name: string
# session_key: string
class UserAccount < ApplicationRecord
  has_secure_password validations: false
  validates :email, presence: true
  validates :first_name, presence: true
  validates :last_name, presence: true
  validates :role, presence: true, inclusion: { in: %w[master regular] }

  def full_name
    "#{first_name} #{last_name}"
  end
end