From 9b61e4a41ba753a9595579c3b11ca06bc01a0807 Mon Sep 17 00:00:00 2001 From: Guillem Arias Date: Mon, 11 May 2026 20:08:32 +0200 Subject: [PATCH] refactor: rename Savings Goals feature to Goals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User-facing rename + structural rename. Feature is now called just "Goals" everywhere — page title, sidebar nav, modal headings, flash messages, AI assistant tool. Code identifiers follow: - Models: SavingsGoal → Goal, SavingsContribution → GoalContribution, SavingsGoalAccount → GoalAccount. - Tables: savings_goals → goals, savings_contributions → goal_contributions, savings_goal_accounts → goal_accounts. FK columns savings_goal_id → goal_id. New migration db/migrate/20260511100003_rename_savings_to_goals.rb uses rename_table + rename_column; PG handles index renaming and FK redirection automatically. - Controllers: SavingsGoalsController → GoalsController, SavingsContributionsController → GoalContributionsController. - Routes: /savings_goals → /goals, nested /goals/:id/contributions (resource name shifts; old route name aliases dropped). - ViewComponent namespace: Savings::* → Goals::*. Component class names drop their redundant "Goal" prefix where the namespace already carries it: Savings::GoalCardComponent → Goals::CardComponent, Savings::GoalAvatarComponent → Goals::AvatarComponent. Others keep their names (Goals::ProgressRingComponent, Goals::StatusPillComponent, Goals::AccountStackComponent, Goals::FundingAccountsBreakdownComponent). - Stimulus controllers: savings_goal_* → goal_*, savings_goals_filter → goals_filter. Stimulus identifiers in data-controller / data-* attributes follow. - Locale keys: savings_goals: → goals: (top level), savings_contributions: → goal_contributions: (top level). All t() callers updated. - AI assistant tool: Assistant::Function::CreateSavingsGoal → Assistant::Function::CreateGoal, tool name "create_savings_goal" → "create_goal", description / response text updated. - Sidebar nav label "Savings" → "Goals". Goals/show + index page title "Savings" → "Goals". Empty goals_section heading/subtitle dropped (duplicated the page title post-rename). Original migrations create_savings_goals / create_savings_goal_accounts / create_savings_contributions remain untouched so historical replay still works; the rename migration runs on top. --- .../account_stack_component.html.erb | 2 +- .../account_stack_component.rb | 2 +- .../avatar_component.html.erb} | 2 +- .../avatar_component.rb} | 6 +- .../card_component.html.erb} | 28 +-- .../card_component.rb} | 32 +-- ...ding_accounts_breakdown_component.html.erb | 10 +- .../funding_accounts_breakdown_component.rb | 2 +- .../progress_ring_component.html.erb | 4 +- .../progress_ring_component.rb | 2 +- .../status_pill_component.html.erb | 0 .../status_pill_component.rb | 4 +- .../goal_contributions_controller.rb | 58 ++++++ ...oals_controller.rb => goals_controller.rb} | 108 +++++----- .../savings_contributions_controller.rb | 58 ------ ...js => goal_projection_chart_controller.js} | 8 +- ...ntroller.js => goal_stepper_controller.js} | 12 +- ...ntroller.js => goals_filter_controller.js} | 2 +- app/models/account.rb | 6 +- app/models/assistant.rb | 2 +- ...{create_savings_goal.rb => create_goal.rb} | 20 +- app/models/demo/generator.rb | 16 +- app/models/family.rb | 6 +- app/models/{savings_goal.rb => goal.rb} | 46 ++--- app/models/goal_account.rb | 6 + ...s_contribution.rb => goal_contribution.rb} | 18 +- app/models/savings_goal_account.rb | 6 - .../new.html.erb | 4 +- .../_contributions_list.html.erb | 18 +- .../_empty_state.html.erb | 14 +- .../_form_edit.html.erb | 24 +-- app/views/goals/_form_stepper.html.erb | 188 ++++++++++++++++++ .../{savings_goals => goals}/edit.html.erb | 2 +- .../{savings_goals => goals}/index.html.erb | 54 +++-- .../{savings_goals => goals}/new.html.erb | 4 +- .../{savings_goals => goals}/show.html.erb | 154 +++++++------- app/views/layouts/application.html.erb | 2 +- .../savings_goals/_form_stepper.html.erb | 188 ------------------ .../models/{savings_goal => goal}/en.yml | 4 +- .../en.yml | 4 +- .../en.yml | 2 +- .../views/{savings_goals => goals}/en.yml | 18 +- config/locales/views/layout/en.yml | 2 +- config/routes.rb | 4 +- .../20260511100003_rename_savings_to_goals.rb | 10 + db/schema.rb | 102 +++++----- .../goal_contributions_controller_test.rb | 58 ++++++ ...oller_test.rb => goals_controller_test.rb} | 80 ++++---- .../savings_contributions_controller_test.rb | 58 ------ ...gs_goal_accounts.yml => goal_accounts.yml} | 8 +- ...ntributions.yml => goal_contributions.yml} | 6 +- .../fixtures/{savings_goals.yml => goals.yml} | 0 ...vings_goal_test.rb => create_goal_test.rb} | 14 +- test/models/goal_contribution_test.rb | 46 +++++ .../{savings_goal_test.rb => goal_test.rb} | 34 ++-- test/models/savings_contribution_test.rb | 46 ----- 56 files changed, 810 insertions(+), 804 deletions(-) rename app/components/{savings => goals}/account_stack_component.html.erb (81%) rename app/components/{savings => goals}/account_stack_component.rb (82%) rename app/components/{savings/goal_avatar_component.html.erb => goals/avatar_component.html.erb} (85%) rename app/components/{savings/goal_avatar_component.rb => goals/avatar_component.rb} (87%) rename app/components/{savings/goal_card_component.html.erb => goals/card_component.html.erb} (60%) rename app/components/{savings/goal_card_component.rb => goals/card_component.rb} (62%) rename app/components/{savings => goals}/funding_accounts_breakdown_component.html.erb (63%) rename app/components/{savings => goals}/funding_accounts_breakdown_component.rb (79%) rename app/components/{savings => goals}/progress_ring_component.html.erb (78%) rename app/components/{savings => goals}/progress_ring_component.rb (88%) rename app/components/{savings => goals}/status_pill_component.html.erb (100%) rename app/components/{savings => goals}/status_pill_component.rb (91%) create mode 100644 app/controllers/goal_contributions_controller.rb rename app/controllers/{savings_goals_controller.rb => goals_controller.rb} (64%) delete mode 100644 app/controllers/savings_contributions_controller.rb rename app/javascript/controllers/{savings_goal_projection_chart_controller.js => goal_projection_chart_controller.js} (98%) rename app/javascript/controllers/{savings_goal_stepper_controller.js => goal_stepper_controller.js} (96%) rename app/javascript/controllers/{savings_goals_filter_controller.js => goals_filter_controller.js} (98%) rename app/models/assistant/function/{create_savings_goal.rb => create_goal.rb} (90%) rename app/models/{savings_goal.rb => goal.rb} (82%) create mode 100644 app/models/goal_account.rb rename app/models/{savings_contribution.rb => goal_contribution.rb} (66%) delete mode 100644 app/models/savings_goal_account.rb rename app/views/{savings_contributions => goal_contributions}/new.html.erb (81%) rename app/views/{savings_goals => goals}/_contributions_list.html.erb (62%) rename app/views/{savings_goals => goals}/_empty_state.html.erb (59%) rename app/views/{savings_goals => goals}/_form_edit.html.erb (51%) create mode 100644 app/views/goals/_form_stepper.html.erb rename app/views/{savings_goals => goals}/edit.html.erb (70%) rename app/views/{savings_goals => goals}/index.html.erb (79%) rename app/views/{savings_goals => goals}/new.html.erb (78%) rename app/views/{savings_goals => goals}/show.html.erb (59%) delete mode 100644 app/views/savings_goals/_form_stepper.html.erb rename config/locales/models/{savings_goal => goal}/en.yml (95%) rename config/locales/models/{savings_contribution => goal_contribution}/en.yml (90%) rename config/locales/views/{savings_contributions => goal_contributions}/en.yml (94%) rename config/locales/views/{savings_goals => goals}/en.yml (96%) create mode 100644 db/migrate/20260511100003_rename_savings_to_goals.rb create mode 100644 test/controllers/goal_contributions_controller_test.rb rename test/controllers/{savings_goals_controller_test.rb => goals_controller_test.rb} (60%) delete mode 100644 test/controllers/savings_contributions_controller_test.rb rename test/fixtures/{savings_goal_accounts.yml => goal_accounts.yml} (61%) rename test/fixtures/{savings_contributions.yml => goal_contributions.yml} (81%) rename test/fixtures/{savings_goals.yml => goals.yml} (100%) rename test/models/assistant/function/{create_savings_goal_test.rb => create_goal_test.rb} (89%) create mode 100644 test/models/goal_contribution_test.rb rename test/models/{savings_goal_test.rb => goal_test.rb} (78%) delete mode 100644 test/models/savings_contribution_test.rb diff --git a/app/components/savings/account_stack_component.html.erb b/app/components/goals/account_stack_component.html.erb similarity index 81% rename from app/components/savings/account_stack_component.html.erb rename to app/components/goals/account_stack_component.html.erb index 9c4c933e0..c8fa6be8c 100644 --- a/app/components/savings/account_stack_component.html.erb +++ b/app/components/goals/account_stack_component.html.erb @@ -1,7 +1,7 @@