]> cat aescling's git repositories - mastodon.git/commitdiff
Remove timestamps on any option (#5282)
authorJeong Arm <kjwonmail@gmail.com>
Mon, 9 Oct 2017 15:52:02 +0000 (00:52 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 9 Oct 2017 15:52:02 +0000 (17:52 +0200)
config/initializers/paperclip.rb

index 85e97a3ce3dd441800a95d1262e9ebbcf79f2f2c..2c82a91db9026ec0ab5ff01033311bb906a8b75f 100644 (file)
@@ -7,6 +7,8 @@ Paperclip.interpolates :filename do |attachment, style|
   [basename(attachment, style), extension(attachment, style)].delete_if(&:blank?).join('.')
 end
 
+Paperclip::Attachment.default_options[:use_timestamp]  = false
+
 if ENV['S3_ENABLED'] == 'true'
   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_permissions] = ENV.fetch('S3_PERMISSION') { 'public-read' }
   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] = {
     bucket: ENV.fetch('S3_BUCKET'),