Sha256: e41d5634e99650a86b614a89b69de9d4c8972d65532902688d48d37af5476f1f
Contents?: true
Size: 614 Bytes
Versions: 29
Compression:
Stored size: 614 Bytes
Contents
module Lev class ErrorTranslator 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 ||? message = error.message || Lev::BetterActiveModelErrors.generate_message(model, attribute, error.code) Lev::BetterActiveModelErrors.full_message(model, attribute, message) else message = error.message.to_s message.empty? ? error.code.to_s : message end end end end
Version data entries
29 entries across 29 versions & 1 rubygems