clarify restore
This commit is contained in:
parent
d58aca0693
commit
d0b04b03b4
1 changed files with 7 additions and 3 deletions
|
@ -15,11 +15,15 @@ module Backup
|
|||
end
|
||||
|
||||
def restore
|
||||
if File.exists?(app_uploads_dir)
|
||||
FileUtils.mv(app_uploads_dir, Rails.root.join('public', "uploads.#{Time.now.to_i}"))
|
||||
end
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue