Exception: FunWithJsonApi::Exceptions::UnauthorizedRelationship
- Inherits:
-
FunWithJsonApi::Exception
- Object
- StandardError
- FunWithJsonApi::Exception
- FunWithJsonApi::Exceptions::UnauthorizedRelationship
- Defined in:
- lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
Overview
Indicates a supplied relationship value is known but unable to be changed by this endpoint
Instance Attribute Summary
Attributes inherited from FunWithJsonApi::Exception
Instance Method Summary collapse
-
#initialize(message, payload = ExceptionPayload.new) ⇒ UnauthorizedRelationship
constructor
A new instance of UnauthorizedRelationship.
Methods inherited from FunWithJsonApi::Exception
Constructor Details
#initialize(message, payload = ExceptionPayload.new) ⇒ UnauthorizedRelationship
Returns a new instance of UnauthorizedRelationship.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/fun_with_json_api/exceptions/unauthorized_relationship.rb', line 5 def initialize(, payload = ExceptionPayload.new) payload = Array.wrap(payload).each do |unknown| unknown.code ||= 'unauthorized_relationship' unknown.title ||= I18n.t( :unauthorized_relationship, scope: 'fun_with_json_api.exceptions' ) unknown.status ||= '403' end super end |