|
|
@ -41,7 +41,9 @@ module Attachmentable |
|
|
|
|
|
|
|
|
|
|
|
extensions_for_mime_type = mime_type.empty? ? [] : mime_type.first.extensions |
|
|
|
extensions_for_mime_type = mime_type.empty? ? [] : mime_type.first.extensions |
|
|
|
original_extension = Paperclip::Interpolations.extension(attachment, :original) |
|
|
|
original_extension = Paperclip::Interpolations.extension(attachment, :original) |
|
|
|
|
|
|
|
proper_extension = extensions_for_mime_type.first.to_s |
|
|
|
|
|
|
|
proper_extension = 'jpeg' if proper_extension == 'jpe' |
|
|
|
|
|
|
|
|
|
|
|
extensions_for_mime_type.include?(original_extension) ? original_extension : extensions_for_mime_type.first |
|
|
|
extensions_for_mime_type.include?(original_extension) ? original_extension : proper_extension |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|