Sha256: e332ed231eaec6ce50097a70b59a88c9af6a68a87330882f72f0cfe321e86c5d
Contents?: true
Size: 623 Bytes
Versions: 8
Compression:
Stored size: 623 Bytes
Contents
# frozen_string_literal: true module ActiveModelSerializers module Adapter class Json < Base def serializable_hash(options = nil) options = serialization_options(options) serialized_hash = { root => Attributes.new(serializer, instance_options).serializable_hash(options) } serialized_hash[meta_key] = meta unless meta.blank? self.class.transform_key_casing!(serialized_hash, instance_options) end def meta instance_options.fetch(:meta, nil) end def meta_key instance_options.fetch(:meta_key, 'meta'.freeze) end end end end
Version data entries
8 entries across 8 versions & 2 rubygems