r2web-ru/backend/app/models/user.rb

8 lines
260 B
Ruby

class User < ApplicationRecord
has_secure_password
validates :email, presence: true, uniqueness: true
validates :email, format: { with: URI::MailTo::EMAIL_REGEXP }
validates :username, presence: true
validates :password, presence: true
end