From e30b810eaab11f32ca92c75bde049005dda79b66 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Thu, 3 Dec 2015 13:12:13 +0200 Subject: [PATCH 1/3] Story#109368800 registrar portal now allows contact to have dot in params[:id] --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index f5b81e8b5..c1cc98697 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -67,7 +67,7 @@ Rails.application.routes.draw do # end # end - resources :contacts do + resources :contacts, constraints: {:id => /[^\/]+(?=#{ ActionController::Renderers::RENDERERS.map{|e| "\\.#{e}\\z"}.join("|") })|[^\/]+/} do member do get 'delete' end From 1de2992ce23fc37218c36df497913271cc8c1334 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Thu, 3 Dec 2015 13:31:47 +0200 Subject: [PATCH 2/3] Story#109368800 update validation that contact code may have dot --- 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 7ebfaf684..d3ad609f2 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -26,7 +26,7 @@ class Contact < ActiveRecord::Base validates :ident_country_code, presence: true, if: proc { |c| %w(org priv).include? c.ident_type }, on: :create validates :code, uniqueness: { message: :epp_id_taken }, - format: { with: /\A[\w\-\:]*\Z/i, message: :invalid }, + format: { with: /\A[\w\-\:\.]*\z/i, message: :invalid }, length: { maximum: 100, message: :too_long_contact_code } validate :ident_valid_format? validate :uniq_statuses? From a5adbca28bd099fa9947019cc99b9323a5975f1e Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Thu, 3 Dec 2015 13:51:16 +0200 Subject: [PATCH 3/3] Story#109368800 update validation that contact code may have underscore --- 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 d3ad609f2..fcebe8632 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -26,7 +26,7 @@ class Contact < ActiveRecord::Base validates :ident_country_code, presence: true, if: proc { |c| %w(org priv).include? c.ident_type }, on: :create validates :code, uniqueness: { message: :epp_id_taken }, - format: { with: /\A[\w\-\:\.]*\z/i, message: :invalid }, + format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid }, length: { maximum: 100, message: :too_long_contact_code } validate :ident_valid_format? validate :uniq_statuses?