mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
Improve speed of transactions page (#1752)
* Make demo data more realistic * Fix N+1 transactions query * Lint fixes * Totals query * Consolidate stats calcs * Fix preload * Fix filter clearing * Fix N+1 queries for family sync detection * Reduce queries for rendering transfers * Fix tests * Remove flaky test
This commit is contained in:
parent
53f4b32c33
commit
2c2b600163
22 changed files with 209 additions and 195 deletions
|
@ -44,7 +44,12 @@ class Family < ApplicationRecord
|
|||
end
|
||||
|
||||
def syncing?
|
||||
super || accounts.manual.any?(&:syncing?) || plaid_items.any?(&:syncing?)
|
||||
Sync.where(
|
||||
"(syncable_type = 'Family' AND syncable_id = ?) OR
|
||||
(syncable_type = 'Account' AND syncable_id IN (SELECT id FROM accounts WHERE family_id = ? AND plaid_account_id IS NULL)) OR
|
||||
(syncable_type = 'PlaidItem' AND syncable_id IN (SELECT id FROM plaid_items WHERE family_id = ?))",
|
||||
id, id, id
|
||||
).where(status: [ "pending", "syncing" ]).exists?
|
||||
end
|
||||
|
||||
def eu?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue