si el artículo es nuevo usar el layout como cache_key closes #224

This commit is contained in:
f 2020-12-28 17:55:39 -03:00
parent 8fa21aa315
commit 8b984eafe6

View file

@ -12,7 +12,7 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type,
# Queremos que los artículos nuevos siempre cacheen, si usamos el UUID
# siempre vamos a obtener un item nuevo.
def cache_key
return name.to_s if post.new?
return layout.value + '/' + name.to_s if post.new?
@cache_key ||= 'post/' + post.uuid.value + '/' + name.to_s
end