Add optional S3 config/backend for ActiveStorage
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -110,9 +110,11 @@ Rails.application.configure do
|
||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||
config.action_mailer.raise_delivery_errors = true
|
||||
|
||||
# TODO make configurable
|
||||
# Store attachments in S3-compatible back-end
|
||||
config.active_storage.service = :local
|
||||
if ENV["S3_ENABLED"]
|
||||
config.active_storage.service = :s3
|
||||
else
|
||||
config.active_storage.service = :local
|
||||
end
|
||||
|
||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||
# the I18n.default_locale when a translation cannot be found).
|
||||
|
||||
@@ -52,6 +52,10 @@ Rails.application.configure do
|
||||
|
||||
config.active_job.queue_adapter = :test
|
||||
|
||||
# Store attachments on the local disk (in ./tmp)
|
||||
config.active_storage.service = :test
|
||||
if ENV["S3_ENABLED"]
|
||||
config.active_storage.service = :s3
|
||||
else
|
||||
# Store attachments on the local disk (in ./tmp)
|
||||
config.active_storage.service = :test
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user