mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Hosts attribute for domain info
This commit is contained in:
parent
a3cb7aed41
commit
aa2b46241a
5 changed files with 85 additions and 6 deletions
|
@ -139,6 +139,20 @@ class EppController < ApplicationController
|
|||
}
|
||||
end
|
||||
|
||||
def optional_attribute(element_selector, attribute_selector, options)
|
||||
element = requires(element_selector, allow_blank: options[:allow_blank])
|
||||
return unless element
|
||||
|
||||
attribute = element[attribute_selector]
|
||||
|
||||
return if (attribute && options[:values].include?(attribute)) || !attribute
|
||||
|
||||
epp_errors << {
|
||||
code: '2306',
|
||||
msg: I18n.t('attribute_is_invalid', attribute: attribute_selector)
|
||||
}
|
||||
end
|
||||
|
||||
def exactly_one_of(*selectors)
|
||||
full_selectors = create_full_selectors(*selectors)
|
||||
return if element_count(*full_selectors, use_prefix: false) == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue