clarify restore

This commit is contained in:
Ben Bodenmiller 2013-05-27 04:35:54 -07:00
parent d58aca0693
commit d0b04b03b4

View file

@ -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