class ActiveModel::Errors

def messages

Returns a Hash of attributes with an array of their error messages.
def messages
  hash = to_hash
  hash.default = EMPTY_ARRAY
  hash.freeze
  hash
end