diff options
author | Starfall <us@starfall.systems> | 2023-04-14 19:22:47 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-04-14 19:22:47 -0500 |
commit | 4fe1689de43f4404eb9530fcfbcbfb26d6c1c13a (patch) | |
tree | 6811b845bb7f4966b10dcefa3dea404246f161c7 /app/models/backup.rb | |
parent | 65c1e53a32cabcdbb7bca57002bb0f6acdebe07e (diff) | |
parent | bed63f6dae0879ac840066b031229e0d139089cd (diff) |
Diffstat (limited to 'app/models/backup.rb')
-rw-r--r-- | app/models/backup.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/backup.rb b/app/models/backup.rb index d242fd62c..5feb31d7d 100644 --- a/app/models/backup.rb +++ b/app/models/backup.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: backups @@ -17,6 +18,6 @@ class Backup < ApplicationRecord belongs_to :user, inverse_of: :backups - has_attached_file :dump - do_not_validate_attachment_file_type :dump + has_attached_file :dump, s3_permissions: ->(*) { ENV['S3_PERMISSION'] == '' ? nil : 'private' } + validates_attachment_content_type :dump, content_type: /\Aapplication/ end |