Exception: FunWithJsonApi::Exceptions::RelationshipMethodNotSupported

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

Constant Summary collapse

EXCEPTION_CODE =
'collection_method_not_supported'.freeze

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) ⇒ RelationshipMethodNotSupported

Returns a new instance of RelationshipMethodNotSupported.



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

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