Ash FrameworkAF
Ash Framework7mo ago
24 replies
Joan Gavelán

Loading multitenant resources

Given the following action:
read :list_organizations do
  prepare build(load: [:establishments])
end

I'm listing orgs and need to load their child establishments (which have a multitenancy attribute configured via organization_id). It throws an error saying I need to specify a tenant to load the establishments. How would I set the tenant here?
Solution
read :list_organizations do
  prepare build(load: [:establishments])
  multitenancy :bypass_all
end
Was this page helpful?