提交 8b64df58 编写于 作者: D Dmitriy Zaporozhets

Merge pull request #4067 from bbodenmiller/patch-5

add code comment about backing up folder when restoring
......@@ -15,11 +15,15 @@ module Backup
end
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)
FileUtils.mv(app_uploads_dir, Rails.root.join('public', "uploads.#{Time.now.to_i}"))
end
FileUtils.cp_r(backup_uploads_dir, app_uploads_dir)
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册