From a24cc25e1b8fbaa081414974de09e79e0d20edff Mon Sep 17 00:00:00 2001 From: f Date: Mon, 11 May 2020 19:01:41 -0300 Subject: [PATCH] cada articulo modifica el sitio para calcular la fecha de modificacion mas rapido --- app/controllers/posts_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 8c47c49f..2ab11524 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -15,7 +15,7 @@ class PostsController < ApplicationController @posts.sort_by!(:order, :date).reverse! @usuarie = @site.usuarie? current_usuarie - fresh_when @posts + fresh_when @site end def show @@ -40,6 +40,8 @@ class PostsController < ApplicationController params: params) if (@post = service.create.persisted?) + @site.touch + redirect_to site_posts_path(@site) else render 'posts/new' @@ -65,6 +67,8 @@ class PostsController < ApplicationController params: params) if service.update.persisted? + @site.touch + redirect_to site_posts_path(@site) else render 'posts/edit' @@ -85,6 +89,7 @@ class PostsController < ApplicationController # TODO: Notificar si se pudo o no service.destroy + @site.touch redirect_to site_posts_path(@site) end @@ -98,6 +103,7 @@ class PostsController < ApplicationController params: params) service.reorder + @site.touch redirect_to site_posts_path(@site) end