1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-30 18:49:39 +02:00

Improve speed of transactions page (#1752)
Some checks failed
Publish Docker image / ci (push) Has been cancelled
Publish Docker image / Build docker image (push) Has been cancelled

* 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:
Zach Gollwitzer 2025-01-31 19:08:21 -05:00 committed by GitHub
parent 53f4b32c33
commit 2c2b600163
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 209 additions and 195 deletions

View file

@ -8,10 +8,10 @@ module Account::EntriesHelper
transfers.map(&:transfer).uniq
end
def entries_by_date(entries, selectable: true, totals: false)
entries.reverse_chronological.group_by(&:date).map do |date, grouped_entries|
def entries_by_date(entries, transfers: [], selectable: true, totals: false)
entries.group_by(&:date).map do |date, grouped_entries|
content = capture do
yield grouped_entries
yield [ grouped_entries, transfers.select { |t| t.outflow_transaction.entry.date == date } ]
end
next if content.blank?