]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/users_controller.rb
Update gravatar methods to check for Active Storage images
[rails.git] / app / controllers / users_controller.rb
index 9c918fee751c1e77e59fe92b3f98efe8ca673acd..a3c21cd3d7ac7aefc5414ad952cbb0262d27ceff 100644 (file)
@@ -779,7 +779,7 @@ class UsersController < ApplicationController
   # check if this user has a gravatar and set the user pref is true
   def gravatar_enable(user)
     # code from example https://en.gravatar.com/site/implement/images/ruby/
-    return false if user.image.present?
+    return false if user.avatar.attached?
 
     hash = Digest::MD5.hexdigest(user.email.downcase)
     url = "https://www.gravatar.com/avatar/#{hash}?d=404" # without d=404 we will always get an image back