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