Class: Lev::ErrorTranslator
Class Method Summary collapse
Class Method Details
.translate(error) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/lev/error_translator.rb', line 5 def self.translate(error) case error.kind when :activerecord attribute = error.data[:attribute] = error. model = error.data[:model] ActiveModel::Error.(attribute, , model) else = error..to_s .empty? ? error.code.to_s : end end |