Ask A Question

Notifications

You’re not receiving notifications from this thread.

I am wondering if there is a way to access the current_tenant ID within a sidekiq job?

Michael Smith asked in Rails

I can see that everything is scoped to the tenant via ActsAsTenant.with_tenant
https://github.com/ErwinM/acts_as_tenant/blob/master/lib/acts_as_tenant/sidekiq.rb

but wondering if I wanted to access the ID or the tenant object, how could I do this?

Reply

seems so obvious now 😀
ActsAsTenant.current_tenant.id
that will get the current account ID

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.