mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Refactor
This commit is contained in:
parent
5bb212ba24
commit
3dca771bcb
4 changed files with 5 additions and 4 deletions
|
@ -45,7 +45,7 @@ module Epp::Common
|
||||||
code: code,
|
code: code,
|
||||||
msg: err[:msg],
|
msg: err[:msg],
|
||||||
value: {obj: err[:obj], val: err[:val]},
|
value: {obj: err[:obj], val: err[:val]},
|
||||||
} and break if values.any? {|x| I18n.t("errors.messages.#{x}") == err[:msg] }
|
} and break if values.any? {|x| obj.errors.generate_message(key, x) == err[:msg]}
|
||||||
else
|
else
|
||||||
epp_errors << {
|
epp_errors << {
|
||||||
code: code,
|
code: code,
|
||||||
|
|
|
@ -60,7 +60,7 @@ module Epp::DomainsHelper
|
||||||
super({
|
super({
|
||||||
'2302' => [:epp_domain_taken, :epp_domain_reserved],
|
'2302' => [:epp_domain_taken, :epp_domain_reserved],
|
||||||
'2306' => [:blank, [:out_of_range, {min: 1, max: 13}]],
|
'2306' => [:blank, [:out_of_range, {min: 1, max: 13}]],
|
||||||
'2303' => [:epp_contact_not_found]
|
'2303' => [:not_found]
|
||||||
}, @domain
|
}, @domain
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Domain < ActiveRecord::Base
|
||||||
errors.add(:domain_contacts, {
|
errors.add(:domain_contacts, {
|
||||||
obj: 'contact',
|
obj: 'contact',
|
||||||
val: x[:contact],
|
val: x[:contact],
|
||||||
msg: I18n.t('errors.messages.epp_contact_not_found')
|
msg: errors.generate_message(:domain_contacts, :not_found)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,6 +43,8 @@ en:
|
||||||
blank: 'Required parameter missing - registrant'
|
blank: 'Required parameter missing - registrant'
|
||||||
admin_contacts:
|
admin_contacts:
|
||||||
blank: 'Required parameter missing - admin contact'
|
blank: 'Required parameter missing - admin contact'
|
||||||
|
domain_contacts:
|
||||||
|
not_found: 'Contact was not found'
|
||||||
nameservers:
|
nameservers:
|
||||||
blank: 'Required parameter missing - nameserver'
|
blank: 'Required parameter missing - nameserver'
|
||||||
out_of_range: 'Domain must have %{min}-%{max} nameservers'
|
out_of_range: 'Domain must have %{min}-%{max} nameservers'
|
||||||
|
@ -53,5 +55,4 @@ en:
|
||||||
epp_domain_taken: 'Domain name already exists'
|
epp_domain_taken: 'Domain name already exists'
|
||||||
epp_obj_does_not_exist: 'Object does not exist'
|
epp_obj_does_not_exist: 'Object does not exist'
|
||||||
epp_command_failed: 'Command failed'
|
epp_command_failed: 'Command failed'
|
||||||
epp_contact_not_found: 'Contact was not found'
|
|
||||||
epp_nameservers_range_fail: 'Domain must have %{min}-%{max} nameservers'
|
epp_nameservers_range_fail: 'Domain must have %{min}-%{max} nameservers'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue