5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-18 00:26:21 +00:00

fix: modificado metodo rename en site_service.rb #13077

This commit is contained in:
jazzari 2023-11-14 16:12:15 +01:00
parent 63884a8915
commit 0071ab7328

View file

@ -89,7 +89,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
def rename(name) def rename(name)
moved = false moved = false
moved = false
Site.transaction do Site.transaction do
raise ActiveRecord::Rollback if site.path raise ActiveRecord::Rollback if site.path
site.name = name site.name = name
@ -97,7 +97,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
ActiveStorage::Blob.where(service_name: site.name_was).update_all(service_name: site.name) ActiveStorage::Blob.where(service_name: site.name_was).update_all(service_name: site.name)
site.save site.save
moved = true moved = true
moved = true
rescue StandardError rescue StandardError
FileUtils.mv (site.path, site.path_was) if moved FileUtils.mv (site.path, site.path_was) if moved
raise raise