class JSONAPI::Exceptions::RecordNotFound

Attributes

id[RW]

Public Class Methods

new(id, error_object_overrides = {}) click to toggle source
Calls superclass method JSONAPI::Exceptions::Error::new
# File lib/jsonapi/exceptions.rb, line 89
def initialize(id, error_object_overrides = {})
  @id = id
  super(error_object_overrides)
end

Public Instance Methods

errors() click to toggle source
# File lib/jsonapi/exceptions.rb, line 94
def errors
  [create_error_object(code: JSONAPI::RECORD_NOT_FOUND,
                       status: :not_found,
                       title: I18n.translate('jsonapi-resources.exceptions.record_not_found.title',
                                             default: 'Record not found'),
                       detail: I18n.translate('jsonapi-resources.exceptions.record_not_found.detail',
                                              default: "The record identified by #{id} could not be found.", id: id))]
end