Delayed Job support for ActsAsTenant gem
bundle add acts_as_tenant-delayed_job
Without this gem, DelayedJob would raise
Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=2) (queue=default) RUNNING
[Worker(host:Waqass-MBP.cust.communityfibre.co.uk pid:6058)] Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=2) (queue=default) FAILED (2 prior attempts) with ActsAsTenant::Errors::NoTenantSet: ActsAsTenant::Errors::NoTenantSet
This gem allows for a worker to run a job in the scope of the tenant that enqueued it. To do so, use the ActiveJob notation like
MyMailer.notification(user).deliver_later
The other notation is not supported:
MyMailer.delay.notification(user)
- Fork the repo
- Make changes
- Run test suite with
bundle exec rspec
- Run
bundle exec standardrb
to standardize code formatting - Submit a PR
acts_as_tenant-delayed_job is written by Nuno Costa.
This gem was extracted from ErwinM/acts_as_tenant#316
Copyright (c) 2023 Nuno Costa, released under the MIT license