Sha256: 47a323ff22e291c3faa2105b1e9f1cca5a5b144e28d93f4374d182e9dc73164b
Contents?: true
Size: 918 Bytes
Versions: 20
Compression:
Stored size: 918 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
20 entries across 20 versions & 1 rubygems