Ash FrameworkAF
Ash Framework3y ago
54 replies
gvanders

Loading related resource, filtered using a property on the Join Table

https://hexdocs.pm/ash/relationships.html#more-complex-data-loading

Looking here I see I can specify a query for the loaded resource which is sweet. What I'm wondering is if we have some metadata about the relationship present on the join table, what is the right/ash way to filter the loaded tables? A contrived example would be check User A's relationship to other users, filtered on created_date or some enum. Specifically for many_to_many, though I assume the answer would apply for all
Was this page helpful?