mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
added name_regexp
This commit is contained in:
parent
aaedc31457
commit
17fd942459
1 changed files with 3 additions and 0 deletions
|
@ -28,6 +28,9 @@ class Contact < ApplicationRecord
|
|||
.where('success = false and verified_at IS NOT NULL')
|
||||
}
|
||||
|
||||
NAME_REGEXP = /([\u00A1-\u00B3\u00B5-\u00BF\u0021-\u0026\u0028-\u002C\u003A-\u0040]|
|
||||
[\u005B-\u005F\u007B-\u007E\u2040-\u206F\u20A0-\u20BF\u2100-\u218F])/x.freeze
|
||||
|
||||
validates :name, :email, presence: true
|
||||
validates :name, format: { without: NAME_REGEXP, message: :invalid }, if: -> { priv? }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue