Use ActiveSupport::Cache.expand_cache_key for cache key expansions (#1878)

* Use ActiveSupport::Cache.expand_cache_key for cache key expansions
This commit is contained in:
Mark Abramov
2016-08-14 00:59:36 +03:00
committed by Benjamin Fleischer
parent 6de3f31b6e
commit 5f3bdcc87c
3 changed files with 45 additions and 1 deletions

View File

@@ -263,7 +263,11 @@ module ActiveModel
parts << object_cache_key
parts << adapter_instance.cache_key
parts << serializer_class._cache_digest unless serializer_class._skip_digest?
@cache_key = parts.join('/')
@cache_key = expand_cache_key(parts)
end
def expand_cache_key(parts)
ActiveSupport::Cache.expand_cache_key(parts)
end
# Use object's cache_key if available, else derive a key from the object