lib/identity_cache/encoder.rb in identity_cache-1.1.0 vs lib/identity_cache/encoder.rb in identity_cache-1.2.0

- old
+ new

@@ -1,6 +1,7 @@ # frozen_string_literal: true + module IdentityCache module Encoder DEHYDRATE_EVENT = "dehydration.identity_cache" HYDRATE_EVENT = "hydration.identity_cache" @@ -64,10 +65,10 @@ else coder_from_record(embedded_record_or_records, embedded_record_or_records.class) end end - def record_from_coder(coder, klass) #:nodoc: + def record_from_coder(coder, klass) # :nodoc: record = klass.instantiate(coder[:attributes].dup) if coder.key?(:associations) coder[:associations].each do |name, value| record.instance_variable_set(klass.cached_association(name).dehydrated_variable_name, value)