From ee10e170ec6b8c6f939173ee647f874d4770bc3b Mon Sep 17 00:00:00 2001 From: f Date: Wed, 28 Feb 2024 15:01:36 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20el=20rol=20todav=C3=ADa=20no=20est=C3=A1?= =?UTF-8?q?=20guardado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/site_service.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/site_service.rb b/app/services/site_service.rb index a3649bc5..6b57fc8b 100644 --- a/app/services/site_service.rb +++ b/app/services/site_service.rb @@ -13,7 +13,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do def create self.site = Site.new params - add_role temporal: false, rol: 'usuarie' + role = add_role temporal: false, rol: 'usuarie' site.deploys.build type: 'DeployLocal' # Los sitios de testing no se sincronizan sync_nodes unless site.name.end_with? '.testing' @@ -26,7 +26,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do # que no haya estados intermedios. site.locales = [usuarie.lang] + I18n.available_locales - add_role_to_deploys! + add_role_to_deploys! role site.save && site.config.write && @@ -230,9 +230,9 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do private # Asignar un rol a cada deploy si no lo tenĂ­a ya - def add_role_to_deploys! + def add_role_to_deploys!(role = current_role) site.deploys.each do |deploy| - deploy.rol ||= current_role + deploy.rol ||= role end end