diff options
author | Ben Bodenmiller <bbodenmiller@hotmail.com> | 2013-05-27 04:35:54 -0700 |
---|---|---|
committer | Ben Bodenmiller <bbodenmiller@hotmail.com> | 2013-05-27 04:35:54 -0700 |
commit | d0b04b03b488bc5c78dfdadca61fbbccffd4853b (patch) | |
tree | 589dd9a5b5caf50ea74c268c75a7fe76b66c3150 /lib/backup | |
parent | d58aca0693d28e17633fb0d2825f1cddfd4f0748 (diff) | |
download | gitlab-ce-d0b04b03b488bc5c78dfdadca61fbbccffd4853b.tar.gz |
clarify restore
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/uploads.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/backup/uploads.rb b/lib/backup/uploads.rb index 4a38af02522..462d3f1e274 100644 --- a/lib/backup/uploads.rb +++ b/lib/backup/uploads.rb @@ -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 |