Attribute is added to error messages

This commit is contained in:
Priit Tark 2015-03-05 11:06:55 +02:00
parent fdac633f07
commit bca9ddef16
5 changed files with 72 additions and 61 deletions

View file

@ -25,7 +25,8 @@ module EppErrors
errors.each do |err|
code, value = find_epp_code_and_value(err)
next unless code
epp_errors << { code: code, msg: "#{err} [#{attr}]", value: value }
msg = attr.to_sym == :base ? err : "#{err} [#{attr}]"
epp_errors << { code: code, msg: msg, value: value }
end
epp_errors
end