Defer deletion of avatars to a background job
[rails.git] / app / controllers / users_controller.rb
index 8c23400..9c918fe 100644 (file)
@@ -665,10 +665,10 @@ class UsersController < ApplicationController
       user.avatar.attach(params[:user][:avatar])
       user.image_use_gravatar = false
     when "delete" then
-      user.avatar.purge
+      user.avatar.purge_later
       user.image_use_gravatar = false
     when "gravatar" then
-      user.avatar.purge
+      user.avatar.purge_later
       user.image_use_gravatar = true
     end