Sha256: a0b96b4f882e439b5d344410d11ef73ffe59fdca1d9304523610ebc972d8a069

Contents?: true

Size: 539 Bytes

Versions: 11

Compression:

Stored size: 539 Bytes

Contents

module FunWithJsonApi
  module Exceptions
    # Indicates a supplied relationship value is unknown to the current deserializer
    class UnknownRelationship < FunWithJsonApi::Exception
      def initialize(message, payload = ExceptionPayload.new)
        payload = Array.wrap(payload).each do |unknown|
          unknown.code ||= 'unknown_relationship'
          unknown.title ||= I18n.t(:unknown_relationship, scope: 'fun_with_json_api.exceptions')
          unknown.status ||= '422'
        end
        super
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fun_with_json_api-0.0.8.2 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.8.1 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.8 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.7 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.6.pre.alpha.2 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.6.pre.alpha.1 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.6.1 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.6 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.5 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.4 lib/fun_with_json_api/exceptions/unknown_relationship.rb
fun_with_json_api-0.0.3 lib/fun_with_json_api/exceptions/unknown_relationship.rb