Sha256: 8c49689d737d53f3e3883a53bc0b9b8389788fe3d6a7f5f71f9ac03add92f952
Contents?: true
Size: 549 Bytes
Versions: 6
Compression:
Stored size: 549 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 error.code.to_s end end end end
Version data entries
6 entries across 6 versions & 1 rubygems