Sha256: 37050e796888023d87797c9f88b92cda262432679cafb20bbf2a8a95c7892f33

Contents?: true

Size: 365 Bytes

Versions: 21

Compression:

Stored size: 365 Bytes

Contents

require 'fun_with_json_api/exception_payload_serializer'

module FunWithJsonApi
  class ExceptionSerializer < ActiveModel::Serializer::CollectionSerializer
    def initialize(exception, options = {})
      super(exception.payload, options.reverse_merge(
        serializer: ExceptionPayloadSerializer
      ))
    end

    def root
      'errors'
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
fun_with_json_api-0.0.11.1 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.11 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.10.4 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.10.3 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.10.2 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.10.1 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.10 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.9 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.8.2 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.8.1 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.8 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.7 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.6.pre.alpha.2 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.6.pre.alpha.1 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.6.1 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.6 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.5 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.4 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.3 lib/fun_with_json_api/exception_serializer.rb
fun_with_json_api-0.0.2 lib/fun_with_json_api/exception_serializer.rb