Class: ActiveModel::ValidationError

Inherits:
Object
  • Object
show all
Defined in:
app/api/core/service/error_handling.rb

Instance Method Summary collapse

Instance Method Details

#api_error(response) ⇒ Object


77
78
79
80
# File 'app/api/core/service/error_handling.rb', line 77

def api_error(response)
  io_handler = ::Core::Io::Registry.instance.lookup_for_object(model)
  response.content_error(422, errors_grouped_by_attribute { |attribute| io_handler.json_field_for(attribute) })
end