resolve collection cache error

This commit is contained in:
quake wang
2017-09-08 18:51:51 +09:00
committed by Benjamin Fleischer
parent ca531789c3
commit a9ea81a831
2 changed files with 6 additions and 7 deletions

View File

@@ -415,7 +415,7 @@ module ActiveModelSerializers
adapter_options = {}
adapter_instance = ActiveModelSerializers::Adapter::Attributes.new(serializers, adapter_options)
serializers.serializable_hash(adapter_options, options, adapter_instance)
cached_attributes = adapter_options.fetch(:cached_attributes).with_indifferent_access
cached_attributes = options.fetch(:cached_attributes).with_indifferent_access
include_directive = ActiveModelSerializers.default_include_directive
manual_cached_attributes = ActiveModel::Serializer.cache_read_multi(serializers, adapter_instance, include_directive).with_indifferent_access
@@ -446,9 +446,9 @@ module ActiveModelSerializers
serializers.serializable_hash(adapter_options, options, adapter_instance)
# Should find something with read_multi now
adapter_options = {}
options = {}
serializers.serializable_hash(adapter_options, options, adapter_instance)
cached_attributes = adapter_options.fetch(:cached_attributes)
cached_attributes = options.fetch(:cached_attributes)
include_directive = ActiveModelSerializers.default_include_directive
manual_cached_attributes = ActiveModel::Serializer.cache_read_multi(serializers, adapter_instance, include_directive)