mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Add exception to EppErrors concerning settings
This commit is contained in:
parent
87cc7799be
commit
b42357b26d
3 changed files with 16 additions and 5 deletions
|
@ -28,7 +28,17 @@ module EppErrors
|
|||
else
|
||||
next unless code = find_epp_code(err)
|
||||
err = {code: code, msg: err}
|
||||
err[:value] = {val: send(key), obj: self.class::EPP_ATTR_MAP[key]} unless self.class.reflect_on_association(key)
|
||||
|
||||
# If we have setting relation, then still add the value to the error message
|
||||
# If this sort of exception happens again, some other logic has to be implemented
|
||||
if self.class.reflect_on_association(key) && key == :setting
|
||||
err[:value] = {val: send(key).value, obj: self.class::EPP_ATTR_MAP[key]}
|
||||
|
||||
#if the key represents other relations, skip value
|
||||
elsif !self.class.reflect_on_association(key)
|
||||
err[:value] = {val: send(key), obj: self.class::EPP_ATTR_MAP[key]}
|
||||
end
|
||||
|
||||
epp_errors << err
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue