Sha256: 45ab4a13c564d5fadd5128067d50e5fb3b6dbe1872587272d237c51eab4a1f80
Contents?: true
Size: 743 Bytes
Versions: 3
Compression:
Stored size: 743 Bytes
Contents
class ActiveModel::Serializer::Adapter::JsonApi::FragmentCache def fragment_cache(root, cached_hash, non_cached_hash) hash = {} core_cached = cached_hash.first core_non_cached = non_cached_hash.first no_root_cache = cached_hash.delete_if { |key, value| key == core_cached[0] } no_root_non_cache = non_cached_hash.delete_if { |key, value| key == core_non_cached[0] } cached_resource = (core_cached[1]) ? core_cached[1].deep_merge(core_non_cached[1]) : core_non_cached[1] hash = (root) ? { root => cached_resource } : cached_resource hash.deep_merge no_root_non_cache.deep_merge no_root_cache end end
Version data entries
3 entries across 3 versions & 2 rubygems