Sha256: 747ade0d7703a955974bdd149f310e4ce4436a413f90536a6a63c1ddda2ee839
Contents?: true
Size: 875 Bytes
Versions: 8
Compression:
Stored size: 875 Bytes
Contents
module Skylight module Normalizers module ActiveModelSerializers class Render < Normalizer register "render.active_model_serializers" CAT = "view.render.active_model_serializers".freeze ANONYMOUS = "<Anonymous Serializer>".freeze def normalize(_trace, _name, payload) serializer_class = payload[:serializer] title = serializer_class.name || ANONYMOUS title = title.sub(/^ActiveModel::(Serializer::)?/, "") if (adapter_instance = payload[:adapter]) adapter_name = adapter_instance.class.name.to_s. sub(/^ActiveModel::Serializer::Adapter::/, ""). sub(/^ActiveModelSerializers::Adapter::/, "") desc = "Adapter: #{adapter_name}" end [CAT, title, desc] end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems