Module: DelayedJobAdapterMonkeyPatch
- Defined in:
- lib/acts_as_tenant/delayed_job/active_job_adapter.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/acts_as_tenant/delayed_job/active_job_adapter.rb', line 2 def perform if tenant_account ActsAsTenant.with_tenant(tenant_account) do super end else super end end |
#tenant_account ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/acts_as_tenant/delayed_job/active_job_adapter.rb', line 12 def tenant_account @tenant_account ||= begin account = job_data.delete("acts_as_tenant") return unless account account["tenant_class"].constantize.find(account["tenant_id"]) end end |