]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/users_controller.rb
Move user images to Active Storage with paperclip as a fallback
[rails.git] / app / controllers / users_controller.rb
index 17031848d7c4503f822400dcbb4a3bf8b5587596..8c234006e4477172d457eeb583928b8872256e79 100644 (file)
@@ -660,15 +660,15 @@ class UsersController < ApplicationController
 
     user.languages = params[:user][:languages].split(",")
 
-    case params[:image_action]
+    case params[:avatar_action]
     when "new" then
-      user.image = params[:user][:image]
+      user.avatar.attach(params[:user][:avatar])
       user.image_use_gravatar = false
     when "delete" then
-      user.image = nil
+      user.avatar.purge
       user.image_use_gravatar = false
     when "gravatar" then
-      user.image = nil
+      user.avatar.purge
       user.image_use_gravatar = true
     end