Soc/app/models/user.rb

21 lines
437 B
Ruby
Raw Normal View History

2023-08-08 19:25:35 +00:00
# frozen_string_literal: true
class User < ApplicationRecord
has_secure_password
validates :username,
:first_name,
:last_names,
:email,
presence: true
validates :email,
:username,
uniqueness: { case_sensitive: false }
validates :email,
format: { with: /\A.*@.*\..*\z/ } # Only very basic regex
validates :password, confirmation: true
end