From 6f0540d9de018f7dc9f474bdc619c8231282f19d Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 25 Feb 2023 00:20:47 -0600 Subject: Arregla controlador de usuarios --- app/models/user_account.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/models') diff --git a/app/models/user_account.rb b/app/models/user_account.rb index ceb8334..e50961b 100644 --- a/app/models/user_account.rb +++ b/app/models/user_account.rb @@ -9,6 +9,9 @@ class UserAccount < ApplicationRecord has_secure_password validations: false validates :email, presence: true + validates :password, presence: true + validates_format_of :email, + with: /\A(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})\z/i validates :first_name, presence: true validates :last_name, presence: true validates :role, presence: true, inclusion: { in: %w[master regular] } -- cgit v1.2.3