Honor CID and new format independently

This commit is contained in:
Priit Tark 2015-05-06 18:59:58 +03:00
parent 0a07004633
commit ba26ea4bac
5 changed files with 11 additions and 39 deletions

View file

@ -59,7 +59,7 @@ class Epp::ContactsController < EppController
end
def find_contact
code = params[:parsed_frame].css('id').text.strip.upcase.sub(/^CID:/, '')
code = params[:parsed_frame].css('id').text.strip.upcase
@contact = Epp::Contact.find_by_epp_code(code)

View file

@ -118,7 +118,6 @@ class Contact < ActiveRecord::Base
# custom code from client
# add prefix when needed
if code.present?
code.sub!(/^CID:/, '')
prefix, *custom_code = code.split(':')
code = custom_code.join(':') if prefix == registrar.code
end

View file

@ -8,7 +8,8 @@ class Epp::Contact < Contact
class << self
# support legacy search
def find_by_epp_code(code)
find_by(code: code.sub(/^CID:/, ''))
# find_by(code: code.sub(/^CID:/, '')) # legacy support turned off
find_by(code: code)
end
# rubocop: disable Metrics/PerceivedComplexity