Updated contact name data type in schemas

This commit is contained in:
tsoganov 2024-08-16 13:35:14 +03:00
parent 9e63e3d0bd
commit c7d3788a36
12 changed files with 109 additions and 45 deletions

View file

@ -46,6 +46,7 @@ class Contact < ApplicationRecord
[\u005B-\u005F\u007B-\u007E\u2040-\u206F\u20A0-\u20BF\u2100-\u218F])/x
validates :name, :email, presence: true
validates :name, length: { maximum: 255, message: :too_long_contact_name }
validates :name, format: { without: NAME_REGEXP, message: :invalid }, if: -> { priv? }
validates :street, :city, :zip, :country_code, presence: true, if: lambda {