class TenantLevelSecurity::Sidekiq::Middleware::Client

Public Instance Methods

call(worker_class, job, queue, redis_pool) { || ... } click to toggle source
# File lib/activerecord-tenant-level-security/sidekiq.rb, line 5
def call(worker_class, job, queue, redis_pool)
  tenant_id = TenantLevelSecurity.current_session_tenant_id
  if tenant_id.present?
    job['tenant_level_security'] ||= { id: tenant_id }
  end

  yield
end