Pass user_id instead of whole User model object in DeleteUserJob

pull/3361/head
Evghenii Barhatov 9 years ago
parent 5e5c2735cc
commit 6ceb63b2b7
  1. 2
      app/services/delete_user_service.rb
  2. 4
      app/workers/delete_user_job.rb

@ -39,7 +39,7 @@ class DeleteUserService < Struct.new :user, :actor
# as destroying users is a lengthy process we handle it in the background
# and lock the account now so that no action can be performed with it
user.lock!
Delayed::Job.enqueue DeleteUserJob.new(user)
Delayed::Job.enqueue DeleteUserJob.new(user.id)
logout! if self_delete?

@ -28,8 +28,8 @@
#++
class DeleteUserJob
def initialize(user)
@user_id = user.id
def initialize(user_id)
@user_id = user_id
end
def perform

Loading…
Cancel
Save