working on image feature
This commit is contained in:
@@ -6,10 +6,11 @@ class BackupsController < ApplicationController
|
||||
end
|
||||
|
||||
def download
|
||||
send_data gzip(BackupExport.call),
|
||||
filename: "car-tracker-backup-#{Time.current.strftime('%Y%m%d%H%M%S')}.yml.gz",
|
||||
type: "application/gzip",
|
||||
disposition: "attachment"
|
||||
send_backup(BackupExport.call(include_images: false), "car-tracker-backup")
|
||||
end
|
||||
|
||||
def download_with_images
|
||||
send_backup(BackupExport.call(include_images: true), "car-tracker-backup-with-images")
|
||||
end
|
||||
|
||||
def restore
|
||||
@@ -21,6 +22,13 @@ class BackupsController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def send_backup(content, basename)
|
||||
send_data gzip(content),
|
||||
filename: "#{basename}-#{Time.current.strftime('%Y%m%d%H%M%S')}.yml.gz",
|
||||
type: "application/gzip",
|
||||
disposition: "attachment"
|
||||
end
|
||||
|
||||
def uploaded_backup
|
||||
params.fetch(:backup_file)
|
||||
rescue KeyError
|
||||
|
||||
Reference in New Issue
Block a user