OSDN Git Service
(root)
/
wvm
/
gitlab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d58aca0
)
clarify restore
author
Ben Bodenmiller
<bbodenmiller@hotmail.com>
Mon, 27 May 2013 11:35:54 +0000
(
04:35
-0700)
committer
Ben Bodenmiller
<bbodenmiller@hotmail.com>
Mon, 27 May 2013 11:35:54 +0000
(
04:35
-0700)
lib/backup/uploads.rb
patch
|
blob
|
history
diff --git
a/lib/backup/uploads.rb
b/lib/backup/uploads.rb
index
4a38af0
..
462d3f1
100644
(file)
--- 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