Add optional S3 config/backend for ActiveStorage

This commit is contained in:
Râu Cao
2023-10-19 14:29:47 +02:00
parent be5fe00f20
commit 1056ffd08e
5 changed files with 34 additions and 7 deletions

View File

@@ -71,6 +71,9 @@ Rails.application.configure do
# Allow requests from any IP
config.web_console.whiny_requests = false
# Store attachments on the local disk (in ./storage)
config.active_storage.service = :local
if ENV["S3_ENABLED"]
config.active_storage.service = :s3
else
config.active_storage.service = :local
end
end