mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 23:36:22 +00:00
merge WIP
This commit is contained in:
parent
7e0ab59ffa
commit
63884a8915
1 changed files with 2 additions and 0 deletions
|
@ -88,6 +88,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
|||
end
|
||||
|
||||
def rename(name)
|
||||
moved = false
|
||||
moved = false
|
||||
Site.transaction do
|
||||
raise ActiveRecord::Rollback if site.path
|
||||
|
@ -96,6 +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)
|
||||
site.save
|
||||
moved = true
|
||||
moved = true
|
||||
rescue StandardError
|
||||
FileUtils.mv (site.path, site.path_was) if moved
|
||||
raise
|
||||
|
|
Loading…
Reference in a new issue