Commit d0b04b03b488bc5c78dfdadca61fbbccffd4853b
1 parent
d58aca06
Exists in
master
and in
4 other branches
clarify restore
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 | ... | ... |