mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
fix n+1 for categories (#1693)
This commit is contained in:
parent
eabfb7aae1
commit
d2a7aef6ef
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ class Budget < ApplicationRecord
|
|||
# Continuous gray segment for empty budgets
|
||||
return [ { color: "#F0F0F0", amount: 1, id: unused_segment_id } ] unless allocations_valid?
|
||||
|
||||
segments = budget_categories.map do |bc|
|
||||
segments = budget_categories.includes(:category).map do |bc|
|
||||
{ color: bc.category.color, amount: bc.actual_spending, id: bc.id }
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue