Ash FrameworkAF
Ash Framework3y ago
5 replies
roberts.gulans

Union relationships

Hello i have 2 resources.

Accounts and Payments.

Each payment has 2 relationships to accounts
relationships do
  belongs_to :debit_account, Budget.Account
  belongs_to :credit_account, Budget.Account
end


And i want to have one relationship in Account
relationships do
  has_many :payments, Budget.Payment
end


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.
Was this page helpful?