diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index 4f91e6ce7..a1ecb31c0 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -4,12 +4,12 @@ if ENV['PAPERCLIP_HASH_SECRET'].nil? exit 1 end -Paperclip::Attachment.default_options.merge!({ +Paperclip::Attachment.default_options.merge!( hash_data: ':class/:attachment/:id/:style', hash_secret: ENV['PAPERCLIP_HASH_SECRET'], - preserve_files: false, + preserve_files: true, url: '/system/:class/:attachment/:id_partition/:hash/:style/:filename' -}) +) if ENV['PAPERCLIP_STORAGE'] == "s3"