From 169c68a739e2907ea29313983bc5a849f585bed3 Mon Sep 17 00:00:00 2001 From: Yusuke Abe Date: Fri, 14 Apr 2017 04:52:56 +0900 Subject: Add filename extension to paperclip (#1718) --- config/initializers/paperclip.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index 2a2ef8fea..c58f1b06c 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -4,7 +4,7 @@ Paperclip.options[:read_timeout] = 60 Paperclip.interpolates :filename do |attachment, style| return attachment.original_filename if style == :original - [basename(attachment, style), extension(attachment, style)].delete_if(&:empty?).join('.') + [basename(attachment, style), content_type_extension(attachment, style)].delete_if(&:empty?).join('.') end if ENV['S3_ENABLED'] == 'true' -- cgit