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 model = error.data[:model] attribute = error.data[:attribute] # TODO error.message might always be populated now -- really need the other call after ||? = error. || Lev::BetterActiveModelErrors.(model, attribute, error.code) Lev::BetterActiveModelErrors.(model, attribute, ) else error.code.to_s end end |