Fix budget money formatting (#1626)

This commit is contained in:
Zach Gollwitzer
2025-01-16 19:05:34 -05:00
committed by GitHub
parent 1ae4b4d612
commit ca8bdb6241
6 changed files with 13 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ class Budget < ApplicationRecord
monetize :budgeted_spending, :expected_income, :allocated_spending,
:actual_spending, :available_to_spend, :available_to_allocate,
:estimated_spending, :estimated_income, :actual_income
:estimated_spending, :estimated_income, :actual_income, :remaining_expected_income
class << self
def for_date(date)
@@ -19,12 +19,13 @@ class Budget < ApplicationRecord
def find_or_bootstrap(family, date: Date.current)
Budget.transaction do
budget = Budget.find_or_create_by(
budget = Budget.find_or_create_by!(
family: family,
start_date: date.beginning_of_month,
end_date: date.end_of_month,
currency: family.currency
)
end_date: date.end_of_month
) do |b|
b.currency = family.currency
end
budget.sync_budget_categories