Class: Statinize::Errors
Instance Method Summary collapse
Methods inherited from Hash
Instance Method Details
#nice ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/statinize/errors.rb', line 13 def nice nice_errors = map do |attr_name, errors| errors.map do |error| "#{attr_name.to_s.split("_").tap { |attr| attr.first.capitalize! }.join(" ")} #{error}" end.join("; ") end.join("; ") "ValidationError: #{nice_errors}" end |