Commit 8b64df58b956ea9c48c090503f921c3b923224b1
Exists in
master
and in
4 other branches
Merge pull request #4067 from bbodenmiller/patch-5
add code comment about backing up folder when restoring
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
lib/backup/uploads.rb
... | ... | @@ -15,11 +15,15 @@ module Backup |
15 | 15 | end |
16 | 16 | |
17 | 17 | def restore |
18 | + backup_existing_uploads_dir | |
19 | + | |
20 | + FileUtils.cp_r(backup_uploads_dir, app_uploads_dir) | |
21 | + end | |
22 | + | |
23 | + def backup_existing_uploads_dir | |
18 | 24 | if File.exists?(app_uploads_dir) |
19 | 25 | FileUtils.mv(app_uploads_dir, Rails.root.join('public', "uploads.#{Time.now.to_i}")) |
20 | 26 | end |
21 | - | |
22 | - FileUtils.cp_r(backup_uploads_dir, app_uploads_dir) | |
23 | 27 | end |
24 | 28 | end |
25 | 29 | end | ... | ... |