working on image feature

This commit is contained in:
2026-10-01 09:56:32 -06:00
parent 7d4e446d4a
commit 23d8154f17
26 changed files with 1259 additions and 57 deletions
+12 -4
View File
@@ -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