diff options
author | ThibG <thib@sitedethib.com> | 2018-06-24 15:27:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-24 15:27:51 +0200 |
commit | c18d55e8c25d47a81f99f5ea018d58eecb206a79 (patch) | |
tree | fe8d33304593499d6c9f87e59a23a51d4d45f9b0 /app/models/concerns | |
parent | f364a27922b19efb312959a562a7541cf9d89e97 (diff) | |
parent | 4b0f27ba7822befed76f8368b472c6ade6977cb2 (diff) |
Merge pull request #553 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/attachmentable.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/concerns/attachmentable.rb b/app/models/concerns/attachmentable.rb index db63c3eca..44bdfa39a 100644 --- a/app/models/concerns/attachmentable.rb +++ b/app/models/concerns/attachmentable.rb @@ -42,8 +42,9 @@ module Attachmentable extensions_for_mime_type = mime_type.empty? ? [] : mime_type.first.extensions original_extension = Paperclip::Interpolations.extension(attachment, :original) proper_extension = extensions_for_mime_type.first.to_s - proper_extension = 'jpeg' if proper_extension == 'jpe' + extension = extensions_for_mime_type.include?(original_extension) ? original_extension : proper_extension + extension = 'jpeg' if extension == 'jpe' - extensions_for_mime_type.include?(original_extension) ? original_extension : proper_extension + extension end end |