Browse Source

Remove timestamps on any option (#5282)

pull/4/head
Jeong Arm 6 years ago
committed by Eugen Rochko
parent
commit
9d97054fe6
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      config/initializers/paperclip.rb

+ 2
- 1
config/initializers/paperclip.rb View File

@ -7,6 +7,8 @@ Paperclip.interpolates :filename do |attachment, style|
[basename(attachment, style), extension(attachment, style)].delete_if(&:blank?).join('.') [basename(attachment, style), extension(attachment, style)].delete_if(&:blank?).join('.')
end end
Paperclip::Attachment.default_options[:use_timestamp] = false
if ENV['S3_ENABLED'] == 'true' if ENV['S3_ENABLED'] == 'true'
Aws.eager_autoload!(services: %w(S3)) Aws.eager_autoload!(services: %w(S3))
@ -18,7 +20,6 @@ if ENV['S3_ENABLED'] == 'true'
Paperclip::Attachment.default_options[:s3_headers] = { 'Cache-Control' => 'max-age=315576000' } Paperclip::Attachment.default_options[:s3_headers] = { 'Cache-Control' => 'max-age=315576000' }
Paperclip::Attachment.default_options[:s3_permissions] = ENV.fetch('S3_PERMISSION') { 'public-read' } Paperclip::Attachment.default_options[:s3_permissions] = ENV.fetch('S3_PERMISSION') { 'public-read' }
Paperclip::Attachment.default_options[:s3_region] = ENV.fetch('S3_REGION') { 'us-east-1' } Paperclip::Attachment.default_options[:s3_region] = ENV.fetch('S3_REGION') { 'us-east-1' }
Paperclip::Attachment.default_options[:use_timestamp] = false
Paperclip::Attachment.default_options[:s3_credentials] = { Paperclip::Attachment.default_options[:s3_credentials] = {
bucket: ENV.fetch('S3_BUCKET'), bucket: ENV.fetch('S3_BUCKET'),

Loading…
Cancel
Save