mirror of
https://github.com/we-promise/sure.git
synced 2026-05-29 23:39:03 +00:00
Regenerate schema.rb after the three v2 migrations so CI's db:schema:load picks up goal_pledges, the dropped goal_contributions, and the partial unique pledge_id index. Brakeman: - Drop :account_id and :kind from goal_pledge permit; look the account up via @goal.linked_accounts.find_by(id:) instead and set kind server-side from goal.any_connected_account?. - Rename goals.show.projection.on_track to .on_track_html so I18n marks the result html_safe automatically; drop the unconditional .html_safe call in show.html.erb. Pledge modal: rewrite app/views/goal_pledges/new.html.erb to use DS::Dialog (the Sure convention for create modals — matches categories/transfers). Error handling: replace `raise ActiveRecord::RecordInvalid, "string"` in GoalPledge#extend!/cancel! with a dedicated GoalPledge::NotOpenError; the controller rescues that specifically. Tests: rewrite the "pace is zero" test to create a fresh account with no entries (the fixture's depository accounts carry transaction history that produces a non-zero pace). All goal tests now green (73 runs, 157 assertions, 0 failures).