Sha256: 87c79b1e1eadac157a79856c11e0c80a4a182bbbf0ac98aafd7ec520916758dd
Contents?: true
Size: 592 Bytes
Versions: 12
Compression:
Stored size: 592 Bytes
Contents
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
12 entries across 12 versions & 2 rubygems