Cross schema many_to_many
Hi, I have two resources let's say A and B, A is using :context multitenancy, B is in the public schema.
I want to have a many_to_many relationship between A and B, using a AB resource that also is using :context multitenancy.
The issue is that when I try to load the B records directly from A (MyApp.get_a(a_id, tenant: tenant, load: [:bs]), The query generated tries to join with an AB table from the public schema, which does not exist as it is a multitenant resource. Did I miss something or is it a bug ? Loading through the join resource does work though (MyApp.get_a(a_id, tenant: tenant, load: [abs: [:b]])
3 Replies
that sounds like it could be a bug. would be able to PR a failing test to AshPostgres by any chance?
So I wrote a test and it passes, so I probably missed something somewhere. I'll keep investigating
Actually nvm, the test fails. I created a PR : https://github.com/ash-project/ash_postgres/pull/627
GitHub
test:add failing test for loading non multitenant resource through ...
Contributor checklist
Leave anything that you believe does not apply unchecked.
I accept the AI Policy, or AI was not used in the creation of this PR.
Bug fixes include regression tests
Chores
...