The personal finance app for everyone (by everyone)
Ruby
Fix transactions page crash when no accounts exist (#1453)
Alex Kreidler0761e8c2375c
diff --git a/app/models/transaction/search.rb b/app/models/transaction/search.rbindex d60e39fb4a..43dfdd78bb 100644--- a/app/models/transaction/search.rb+++ b/app/models/transaction/search.rb@@ -30,7 +30,7 @@ class Transaction::Searchquery = family.transactions.merge(Entry.excluding_split_parents)# Scope to accessible accounts when provided- query = query.where(entries: { account_id: accessible_account_ids }) if accessible_account_ids+ query = query.where(entries: { account_id: accessible_account_ids }) if accessible_account_ids&.any?query = apply_active_accounts_filter(query, active_accounts_only)query = apply_category_filter(query, categories)