mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
submitting empty user form doest raise an error
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ class User < ApplicationRecord
|
||||
|
||||
def has_proper_characters_in_password
|
||||
regex = "(?=.*[[:upper:]])(?=.*[0-9])"
|
||||
if not password.match(regex)
|
||||
if not password&.match(regex)
|
||||
errors.add :password, "doesn't contain uppercase letter and a number"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user