From f927ee1cf75e95fb2afb98401e2b5e95b9d171b1 Mon Sep 17 00:00:00 2001 From: dinsmol Date: Thu, 8 Jul 2021 09:30:53 +0300 Subject: [PATCH] freezed name_regexp --- app/models/contact.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 5bfc1ae00..01a4bab3d 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -29,7 +29,7 @@ class Contact < ApplicationRecord } NAME_REGEXP = /([\u00A1-\u00B3\u00B5-\u00BF\u0021-\u0026\u0028-\u002C\u003A-\u0040]| - [\u005B-\u005F\u007B-\u007E\u2040-\u206F\u20A0-\u20BF\u2100-\u218F])/x + [\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 }