user.rb 469 B

1234567891011121314
  1. class User < ApplicationRecord
  2. # Include default devise modules. Others available are:
  3. # :confirmable, :lockable, :timeoutable and :omniauthable
  4. devise :masqueradable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable
  5. has_many :notifications, foreign_key: :recipient_id
  6. has_many :services
  7. validates :first_name, :last_name, presence: true
  8. def name
  9. "#{first_name} #{last_name}"
  10. end
  11. end