gearheads
/
mastodon
Archived
2
0
Fork 0

Add filename extension to paperclip (#1718)

gh/stable
Yusuke Abe 2017-04-14 04:52:56 +09:00 committed by Eugen
parent 9f182346d7
commit 169c68a739
1 changed files with 1 additions and 1 deletions

View File

@ -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'