From 1c44c91f76e0b17f72a2ef6fcdbd0b49e4057875 Mon Sep 17 00:00:00 2001 From: jazzari Date: Tue, 7 May 2024 15:54:29 -0300 Subject: [PATCH] fix: corregido auto_publish! en Site_service y Post_service #13244 --- app/services/post_service.rb | 9 ++++++--- app/services/site_service.rb | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/services/post_service.rb b/app/services/post_service.rb index f7da581d..256a617d 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -24,7 +24,8 @@ 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.tap(&:auto_publish!) + auto_publish! + post end # Crear un post anónimo, con opciones más limitadas. No usamos post. @@ -37,7 +38,8 @@ 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.tap(&:auto_publish!) + auto_publish! + post end def update @@ -58,7 +60,8 @@ 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.tap(&:auto_publish!) + auto_publish! + post end def destroy diff --git a/app/services/site_service.rb b/app/services/site_service.rb index 1b9ccdb6..0ce09c53 100644 --- a/app/services/site_service.rb +++ b/app/services/site_service.rb @@ -38,7 +38,8 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do deploy end - site.tap(&:auto_publish!) + auto_publish! + site end # Actualiza el sitio y guarda los cambios en la configuración