Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex aggregates doesn't honor tenant #434

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pshoukry
Copy link

@pshoukry pshoukry commented Dec 2, 2024

Following the steps here to use multi-tenancy with dynamic repo. when complex aggregates are called:

aggregates do
    sum :saved_money, [:redeems, :deal], :amount do
  end

When Using Ash.load with tenant, I can see the tenant used in the Tracer switching:

The first call is done with the tenant passed but

the second sum aggregation query is selecting with the default tenant returning no associated records hence sum is 0.

@pshoukry pshoukry changed the title tests: Schema multitenancy fails Complex aggregates doesn't honor tenant Dec 2, 2024
@pshoukry pshoukry marked this pull request as draft December 2, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant