Class: TenantLevelSecurity::Sidekiq::Middleware::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord-tenant-level-security/sidekiq.rb

Instance Method Summary collapse

Instance Method Details

#call(worker, job, queue) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/activerecord-tenant-level-security/sidekiq.rb', line 16

def call(worker, job, queue)
  if job.key?('tenant_level_security')
    TenantLevelSecurity.with(job['tenant_level_security']['id']) do
      yield
    end
  else
    yield
  end
end