From 46479dc31be1a21f21dbd542f6e08d1692ed04cc Mon Sep 17 00:00:00 2001 From: Keijo Raamat Date: Mon, 12 Jul 2021 19:22:17 +0300 Subject: [PATCH] Revert "Merge pull request #2074 from internetee/1795-validation-contacts-name" This reverts commit e2116a505ed64511df074ddc4ed7c64ec3416745, reversing changes made to ded22685c9ff15a7f7c88b77cd32ddbda6891996. --- app/models/contact.rb | 5 ----- test/models/contact_test.rb | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 01a4bab3d..b6b1e979b 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -28,12 +28,7 @@ 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 } - validates :street, :city, :zip, :country_code, presence: true, if: lambda { self.class.address_processing? } diff --git a/test/models/contact_test.rb b/test/models/contact_test.rb index 189a85dc7..4a598b0c7 100644 --- a/test/models/contact_test.rb +++ b/test/models/contact_test.rb @@ -32,16 +32,6 @@ class ContactTest < ActiveJob::TestCase assert contact.invalid? end - def test_allowed_and_disallowed_symbols_for_name - contact = valid_contact - contact.name = 'MARY ÄNN O’CONNEŽ-ŠUSLIK' - assert contact.valid? - contact.name = 'Boğaçhan Çağlayan' - assert contact.valid? - contact.name = '# "¤ #" ¤ "?' - assert contact.invalid? - end - def test_validates_code_format contact = valid_contact.dup max_length = 100