]> git.openstreetmap.org Git - rails.git/blobdiff - app/mailers/notifier.rb
Merge remote-tracking branch 'upstream/pull/2626'
[rails.git] / app / mailers / notifier.rb
index c60dff84b9f0265cfc66137cb5cac3271529e324..cebb4693973c6a772e4d8db609ef7b3ff97e86e8 100644 (file)
@@ -192,7 +192,12 @@ class Notifier < ApplicationMailer
   def user_avatar_file(user)
     avatar = user&.avatar
     if avatar&.attached?
-      avatar.variant(:resize => "50x50>").blob.download
+      if avatar.variable?
+        image = avatar.variant(:resize => "50x50>").processed
+        image.service.download(image.key)
+      else
+        avatar.blob.download
+      end
     else
       File.read(Rails.root.join("app/assets/images/avatar_small.png"))
     end