Commit d0b04b03 authored by Ben Bodenmiller's avatar Ben Bodenmiller

clarify restore

parent d58aca06
...@@ -15,11 +15,15 @@ module Backup ...@@ -15,11 +15,15 @@ module Backup
end end
def restore def restore
backup_existing_uploads_dir
FileUtils.cp_r(backup_uploads_dir, app_uploads_dir)
end
def backup_existing_uploads_dir
if File.exists?(app_uploads_dir) if File.exists?(app_uploads_dir)
FileUtils.mv(app_uploads_dir, Rails.root.join('public', "uploads.#{Time.now.to_i}")) FileUtils.mv(app_uploads_dir, Rails.root.join('public', "uploads.#{Time.now.to_i}"))
end end
FileUtils.cp_r(backup_uploads_dir, app_uploads_dir)
end end
end end
end end
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