From b5b0dc7f21c6d2e882193d8c009a5126c97394e9 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Mon, 14 Dec 2015 14:25:28 +0200 Subject: [PATCH] Story#109590460 - update country code validation --- 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 c1d2f0c96..1bf86b706 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -219,7 +219,7 @@ class Contact < ActiveRecord::Base errors.add(:ident, :invalid_EE_identity_format) unless Isikukood.new(ident).valid? when 'org'.freeze # !%w(1 7 8 9).freeze.include?(ident.first) || - if ident.size != 8 || ident !=~/\A[0-9]{8}\z/ + if ident.size != 8 || !(ident =~/\A[0-9]{8}\z/) errors.add(:ident, :invalid_EE_identity_format) end end