From f3ae46a512579647c45d9f0820efe5e6dc730b14 Mon Sep 17 00:00:00 2001 From: Yusuke Abe Date: Fri, 14 Apr 2017 04:52:56 +0900 Subject: [PATCH] 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 2a2ef8fea7..c58f1b06c0 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'