mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 18:36:23 +00:00
Merge branch 'renovar-cache' into 'rails'
renovar la caché de formularios See merge request sutty/sutty!12
This commit is contained in:
commit
dffae5a49f
1 changed files with 7 additions and 1 deletions
|
@ -19,10 +19,16 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type,
|
|||
@cache_key ||= "post/#{post.uuid.value}/#{name}"
|
||||
end
|
||||
|
||||
# Genera una versión de caché en base a la fecha de modificación del
|
||||
# Post, el valor actual y los valores posibles, de forma que cualquier
|
||||
# cambio permita renovar la caché.
|
||||
#
|
||||
# @return [String]
|
||||
def cache_version
|
||||
value.hash.to_s + values.hash.to_s
|
||||
post.cache_version + value.hash.to_s + values.hash.to_s
|
||||
end
|
||||
|
||||
# @return [String]
|
||||
def cache_key_with_version
|
||||
"#{cache_key}-#{cache_version}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue