Add scope to filter transactions from active accounts (#1810)

* Add scope to filter transactions from active accounts

* Add test for transfer match candidates with active accounts

* Refactor active account filtering for transactions and entries
This commit is contained in:
Josh Pigford
2025-02-05 11:52:44 -06:00
committed by GitHub
parent cf014bc24f
commit 4aba9d1c0b
5 changed files with 69 additions and 1 deletions

View File

@@ -24,6 +24,10 @@ class Account::Entry < ApplicationRecord
)
}
scope :active, -> {
joins(:account).where(accounts: { is_active: true, scheduled_for_deletion: false })
}
scope :reverse_chronological, -> {
order(
date: :desc,