diff options
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/paperclip.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index 643c5d384..80effc05e 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -1,4 +1,6 @@ if ENV['S3_ENABLED'] == 'true' + Aws.eager_autoload!(services: %w(S3)) + Paperclip::Attachment.default_options[:storage] = :s3 Paperclip::Attachment.default_options[:s3_protocol] = 'https' Paperclip::Attachment.default_options[:url] = ':s3_domain_url' @@ -9,6 +11,6 @@ if ENV['S3_ENABLED'] == 'true' bucket: ENV.fetch('S3_BUCKET'), access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'), secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'), - s3_region: ENV.fetch('S3_REGION') + s3_region: ENV.fetch('S3_REGION'), } end |