about summary refs log tree commit diff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-06-21 20:49:57 +0200
committerThibaut Girka <thib@sitedethib.com>2018-06-21 20:49:57 +0200
commitab5f450700085ce73621b28b813f2edc5f199785 (patch)
tree766214b52ed217903ae821285391f8e2d4b5f545 /app/models/concerns
parent26c20a4ec7868753b284670575f28f201a5cef9f (diff)
parent7f59206944193591d7aef5cbd73edc7f5303add7 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
	app/models/user.rb

Resolved by adding :default_language to user settings fields
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/attachmentable.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/concerns/attachmentable.rb b/app/models/concerns/attachmentable.rb
index 6f8489b89..db63c3eca 100644
--- a/app/models/concerns/attachmentable.rb
+++ b/app/models/concerns/attachmentable.rb
@@ -41,7 +41,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'
 
-    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