Union relationships
Hello i have 2 resources.
Accounts and Payments.
Each payment has 2 relationships to accounts
And i want to have one relationship in Account
Is there a way how i could have payments relationship to hold both those so i could have one list with all payments to order/paginate/filter on it.
4 Replies
So you basically want
payments
to be accounts where debit_account_id == id or credit_account_id == id
?
You can do that with manual relationships, and you can describe how to join on them using AshPostgres.ManualRelationship
Thanks mate. Unreal job you have made.
Thanks! 🙇