Replace some hardcoded schema paths for method calls

This commit is contained in:
Alex Sherman 2021-05-21 15:14:31 +05:00
parent a0d0ce3e00
commit 00a0be2341
59 changed files with 481 additions and 480 deletions

View file

@ -7,8 +7,9 @@ xml.epp_head do
xml.result('code' => x[:code]) do
xml.msg(x[:msg], 'lang' => 'en')
model_name = resource ? resource.model_name.singular.sub('epp_','') : controller.controller_name.singularize
prefix = model_name == 'poll' ? 'changePoll' : model_name + '-eis'
xml.value("xmlns:#{model_name}" => "https://epp.tld.ee/schema/#{model_name}-eis-1.0.xsd") do
xml.value("xmlns:#{model_name}" => Xsd::Schema.filename(for_prefix: prefix)) do
value = x[:value][:val]
attrs = {}
attrs["s"] = value if x[:value][:obj] == "status"