5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 22:31:42 +00:00

fix: el rol todavía no está guardado

This commit is contained in:
f 2024-02-28 15:01:36 -03:00
parent f1de4c8073
commit ee10e170ec
No known key found for this signature in database

View file

@ -13,7 +13,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
def create def create
self.site = Site.new params self.site = Site.new params
add_role temporal: false, rol: 'usuarie' role = add_role temporal: false, rol: 'usuarie'
site.deploys.build type: 'DeployLocal' site.deploys.build type: 'DeployLocal'
# Los sitios de testing no se sincronizan # Los sitios de testing no se sincronizan
sync_nodes unless site.name.end_with? '.testing' 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. # que no haya estados intermedios.
site.locales = [usuarie.lang] + I18n.available_locales site.locales = [usuarie.lang] + I18n.available_locales
add_role_to_deploys! add_role_to_deploys! role
site.save && site.save &&
site.config.write && site.config.write &&
@ -230,9 +230,9 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
private private
# Asignar un rol a cada deploy si no lo tenía ya # 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| site.deploys.each do |deploy|
deploy.rol ||= current_role deploy.rol ||= role
end end
end end