From 7bac37f735df67fc0602a42d9dc11179144bcb30 Mon Sep 17 00:00:00 2001 From: dinsmol Date: Wed, 7 Jul 2021 23:31:16 +0300 Subject: [PATCH] minor fixes --- app/models/contact.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 8f35efb06..5bfc1ae00 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -28,10 +28,10 @@ class Contact < ApplicationRecord .where('success = false and verified_at IS NOT NULL') } - validates :name, :email, presence: true - NAME_REGEXP = /([\u00A1-\u00B3\u00B5-\u00BF\u0021-\u0026\u0028-\u002C\u003A-\u0040]| [\u005B-\u005F\u007B-\u007E\u2040-\u206F\u20A0-\u20BF\u2100-\u218F])/x + + validates :name, :email, presence: true validates :name, format: { without: NAME_REGEXP, message: :invalid } validates :street, :city, :zip, :country_code, presence: true, if: lambda {