From cd018385f7c5861b4e425e4d504dd7387d6beade Mon Sep 17 00:00:00 2001 From: jazzari Date: Fri, 3 May 2024 12:43:53 -0300 Subject: [PATCH] fix: corregidos metodos donde se retorna site o post #13244 --- app/services/post_service.rb | 9 +++------ app/services/site_service.rb | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/services/post_service.rb b/app/services/post_service.rb index 9cc41323..f7da581d 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -24,8 +24,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do # Devolver el post aunque no se haya salvado para poder rescatar los # errores - post - auto_publish! + post.tap(&:auto_publish!) end # Crear un post anónimo, con opciones más limitadas. No usamos post. @@ -38,8 +37,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do params[:draft] = true commit(action: :created, add: [post.path.absolute]) if post.update(anon_post_params) - post - auto_publish! + post.tap(&:auto_publish!) end def update @@ -60,8 +58,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do # Devolver el post aunque no se haya salvado para poder rescatar los # errores - post - auto_publish! + post.tap(&:auto_publish!) end def destroy diff --git a/app/services/site_service.rb b/app/services/site_service.rb index 4c83a6dd..1b9ccdb6 100644 --- a/app/services/site_service.rb +++ b/app/services/site_service.rb @@ -38,7 +38,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do deploy end - site + site.tap(&:auto_publish!) end # Actualiza el sitio y guarda los cambios en la configuración