mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
style fixes
This commit is contained in:
parent
22f753aa6c
commit
0e655bf306
7 changed files with 20 additions and 18 deletions
|
@ -63,10 +63,12 @@ module Epp::Common
|
|||
epp_errors.empty?
|
||||
end
|
||||
|
||||
def xml_attrs_array_present?(array_ph, attributes )
|
||||
def xml_attrs_array_present?(array_ph, attributes)
|
||||
[array_ph].flatten.each do |ph|
|
||||
attributes.each do |x|
|
||||
epp_errors << {code: '2003', msg: I18n.t('errors.messages.required_parameter_missing', key: x.last)} unless has_attribute(ph, x)
|
||||
unless has_attribute(ph, x)
|
||||
epp_errors << { code: '2003', msg: I18n.t('errors.messages.required_parameter_missing', key: x.last) }
|
||||
end
|
||||
end
|
||||
end
|
||||
epp_errors.empty?
|
||||
|
|
|
@ -14,10 +14,8 @@ class Address < ActiveRecord::Base
|
|||
# validates_inclusion_of :type, in: TYPES
|
||||
|
||||
class << self
|
||||
|
||||
def validate_postal_info_types(parsed_frame)
|
||||
errors, used = [], []
|
||||
|
||||
parsed_frame.css('postalInfo').each do |pi|
|
||||
attr = pi.attributes['type'].try(:value)
|
||||
errors << { code: 2003, msg: I18n.t('errors.messages.attr_missing', key: 'type') } and next unless attr
|
||||
|
@ -27,8 +25,7 @@ class Address < ActiveRecord::Base
|
|||
end
|
||||
errors << { code: 2005, msg: I18n.t('errors.messages.repeating_postal_info') } and next if used.include?(attr)
|
||||
used << attr
|
||||
end
|
||||
errors
|
||||
end; errors
|
||||
end
|
||||
|
||||
def extract_attributes(ah)
|
||||
|
|
|
@ -19,13 +19,13 @@ class EppSession < ActiveRecord::Base
|
|||
end
|
||||
|
||||
class << self
|
||||
def marshal(data)
|
||||
::Base64.encode64(Marshal.dump(data)) if data
|
||||
end
|
||||
def marshal(data)
|
||||
::Base64.encode64(Marshal.dump(data)) if data
|
||||
end
|
||||
|
||||
def unmarshal(data)
|
||||
return data unless data.is_a? String
|
||||
Marshal.load(::Base64.decode64(data)) if data
|
||||
end
|
||||
def unmarshal(data)
|
||||
return data unless data.is_a? String
|
||||
Marshal.load(::Base64.decode64(data)) if data
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue