class Sidekiq::Middleware::MultiTenant::Client

Get the current tenant and store in the message to be sent to Sidekiq.

Public Instance Methods

call(worker_class, msg, queue, redis_pool) { || ... } click to toggle source
# File lib/activerecord-multi-tenant/sidekiq.rb, line 6
def call(worker_class, msg, queue, redis_pool)
  msg['multi_tenant'] ||=
    {
      'class' => MultiTenant.current_tenant_class,
      'id' => MultiTenant.current_tenant_id
    } if MultiTenant.current_tenant.present?

  yield
end