mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
Update caching.rb
This commit is contained in:
parent
b0039e3758
commit
bd53d9b213
@ -231,7 +231,7 @@ module ActiveModel
|
|||||||
def fetch(adapter_instance, cache_options = serializer_class._cache_options, key = nil)
|
def fetch(adapter_instance, cache_options = serializer_class._cache_options, key = nil)
|
||||||
if serializer_class.cache_store
|
if serializer_class.cache_store
|
||||||
key ||= cache_key(adapter_instance)
|
key ||= cache_key(adapter_instance)
|
||||||
cache_options = cache_options.merge(version: object_cache_version) if object_cache_version
|
cache_options = (cache_options || {}).merge(version: object_cache_version) if object_cache_version
|
||||||
serializer_class.cache_store.fetch(key, cache_options) do
|
serializer_class.cache_store.fetch(key, cache_options) do
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user