mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
using validation for only person names
This commit is contained in:
parent
f927ee1cf7
commit
aa7cf1d1b3
3 changed files with 7 additions and 1 deletions
|
@ -32,7 +32,7 @@ class Contact < ApplicationRecord
|
|||
[\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 }
|
||||
validates :name, format: { without: NAME_REGEXP, message: :invalid }, if: -> { priv? }
|
||||
|
||||
validates :street, :city, :zip, :country_code, presence: true, if: lambda {
|
||||
self.class.address_processing?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue