GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 3524a618 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Improve migration/rollback logic for attachments

parent 61d77a04
......@@ -22,10 +22,14 @@ def execute
@new_disk_path = project.disk_path
result = move_folder!(origin, target)
project.save!
if result && block_given?
yield
if result
project.save!
yield if block_given?
else
# Rollback changes
project.rollback!
end
result
......
......@@ -17,10 +17,14 @@ def execute
@new_disk_path = FileUploader.base_dir(project)
result = move_folder!(origin, target)
project.save!
if result && block_given?
yield
if result
project.save!
yield if block_given?
else
# Rollback changes
project.rollback!
end
result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment