Exception: FunWithJsonApi::Exceptions::MissingRelationship

Inherits:
FunWithJsonApi::Exception show all
Defined in:
lib/fun_with_json_api/exceptions/missing_relationship.rb

Overview

Indicates a Supplied relationships value is not able to be found

Instance Attribute Summary

Attributes inherited from FunWithJsonApi::Exception

#payload

Instance Method Summary collapse

Methods inherited from FunWithJsonApi::Exception

#http_status

Constructor Details

#initialize(message, payload = ExceptionPayload.new) ⇒ MissingRelationship

Returns a new instance of MissingRelationship.



5
6
7
8
9
10
11
12
# File 'lib/fun_with_json_api/exceptions/missing_relationship.rb', line 5

def initialize(message, payload = ExceptionPayload.new)
  payload = Array.wrap(payload).each do |missing|
    missing.code ||= 'missing_relationship'
    missing.title ||= I18n.t(:missing_relationship, scope: 'fun_with_json_api.exceptions')
    missing.status ||= '404'
  end
  super
end