]> cat aescling's git repositories - mastodon.git/commitdiff
Fix cloudfront config
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 3 Dec 2016 21:12:22 +0000 (22:12 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 3 Dec 2016 21:12:22 +0000 (22:12 +0100)
config/initializers/paperclip.rb

index 78f77c2b57cfd61a067f21d64c6cc4817a2e6ae0..4c2053e2cc8d863f21dba91e1c00fa56b313425e 100644 (file)
@@ -7,7 +7,7 @@ if ENV['S3_ENABLED'] == 'true'
   Paperclip::Attachment.default_options[:s3_host_name] = "s3-#{ENV.fetch('S3_REGION')}.amazonaws.com"
   Paperclip::Attachment.default_options[:path]         = '/:class/:attachment/:id_partition/:style/:filename'
 
-  if ENV['S3_CLOUDFRONT_HOST'] == ''
+  unless ENV['S3_CLOUDFRONT_HOST'].blank?
     Paperclip::Attachment.default_options[:url]           = ':s3_alias_url'
     Paperclip::Attachment.default_options[:s3_host_alias] = ENV['S3_CLOUDFRONT_HOST']
   end