Add filename extension to paperclip (#1718)
parent
03fe4e36a6
commit
f3ae46a512
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue