mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
The `subcategories` method queries `WHERE parent_id = category.id`, but for the synthetic uncategorized budget category, `category.id` is nil. This caused `WHERE parent_id IS NULL` to match ALL top-level categories, making them appear as subcategories of uncategorized. This inflated actual_spending and produced a large negative available_to_spend. Add a nil guard on category.id to return an empty relation for synthetic categories. Fixes #819 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>