Class: Decidim::Admin::ExpireImpersonationJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
decidim-admin/app/jobs/decidim/admin/expire_impersonation_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(user, current_user) ⇒ Object


8
9
10
11
12
13
# File 'decidim-admin/app/jobs/decidim/admin/expire_impersonation_job.rb', line 8

def perform(user, current_user)
  impersonation_log = Decidim::ImpersonationLog.where(admin: current_user, user: user).active.first
  return unless impersonation_log

  impersonation_log.expire!
end