5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-02 06:24:17 +00:00
This commit is contained in:
f 2022-04-11 14:57:28 -03:00
parent f9e0ad698b
commit 02d72f4227

View file

@ -29,7 +29,7 @@ class Post
# TODO: Reemplazar cuando leamos el contenido del Document
# a demanda?
def find_layout(path)
IO.foreach(path).lazy.grep(/^layout: /).take(1).first&.split(' ')&.last&.tr('\'', '')&.tr('"', '')&.to_sym
File.foreach(path).lazy.grep(/^layout: /).take(1).first&.split(' ')&.last&.tr('\'', '')&.tr('"', '')&.to_sym
end
end
@ -114,7 +114,7 @@ class Post
# Devuelve una llave para poder guardar el post en una cache
def cache_key
'posts/' + uuid.value
"posts/#{uuid.value}"
end
def cache_version
@ -124,7 +124,7 @@ class Post
# Agregar el timestamp para saber si cambió, siguiendo el módulo
# ActiveRecord::Integration
def cache_key_with_version
cache_key + '-' + cache_version
"#{cache_key}-#{cache_version}"
end
# TODO: Convertir a UUID?