From 6b8472040184df3edcb7aeb0701f3df77f15d12d Mon Sep 17 00:00:00 2001 From: f Date: Thu, 6 May 2021 18:10:31 -0300 Subject: [PATCH] =?UTF-8?q?si=20los=20art=C3=ADculos=20son=20nuevos=20no?= =?UTF-8?q?=20tienen=20llave=20para=20cachearlos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/post.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index a0e16706..461733f9 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -110,7 +110,7 @@ class Post end def cache_version - updated_at.utc.to_s(:usec) + (updated_at || modified_at).utc.to_s(:usec) end # Agregar el timestamp para saber si cambió, siguiendo el módulo @@ -127,6 +127,8 @@ class Post # Fecha de última modificación del archivo def updated_at + return if new? + File.mtime(path.absolute) end