]> cat aescling's git repositories - mastodon.git/commitdiff
Improve S3 config
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 6 Nov 2016 17:55:20 +0000 (18:55 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 6 Nov 2016 17:55:20 +0000 (18:55 +0100)
config/initializers/paperclip.rb

index 73eb3356bcfbed09630d330475ad5d54f3c51ced..d727612507dde858ef4d67a593c4313bb50f7bf2 100644 (file)
@@ -7,4 +7,7 @@ if ENV['S3_ENABLED'] == 'true'
     secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
     s3_region: ENV.fetch('S3_REGION')
   }
+
+  Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
+  Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
 end