about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authortmyt <shigure@refy.net>2017-04-19 21:20:36 +0900
committerEugen <eugen@zeonfederated.com>2017-04-19 14:20:36 +0200
commit6c83fec9715340bd178de0a8ba595bb4ad10eb1a (patch)
treec7bdc411ed65a9ecb04b00548502d4c58ca4bc48 /config
parent2bb54d5c573a9783fb5cd36202ef548b23494daa (diff)
Make configuarable s3_permissions for paperclip (#2139)
Diffstat (limited to 'config')
-rw-r--r--config/initializers/paperclip.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index af65ca818..9e2996faa 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -16,7 +16,7 @@ if ENV['S3_ENABLED'] == 'true'
   Paperclip::Attachment.default_options[:s3_host_name]   = ENV.fetch('S3_HOSTNAME') { "s3-#{ENV.fetch('S3_REGION')}.amazonaws.com" }
   Paperclip::Attachment.default_options[:path]           = '/:class/:attachment/:id_partition/:style/:filename'
   Paperclip::Attachment.default_options[:s3_headers]     = { 'Cache-Control' => 'max-age=315576000' }
-  Paperclip::Attachment.default_options[:s3_permissions] = '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_credentials] = {