rubyforgood / rubyforgood/awbw
Scholarship agreement log: settle removal vs keep before dropping the table
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 15
- Forks
- 26
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 242
Description
🤖 From Claude:
Part of #2251. Carved out of that umbrella's follow-ups, which scoped this as: backfill any needed history from scholarship_agreement_responses, then drop the callbacks, the _agreement_history partial, and the table.
Blocked by #2351.
Why it isn't a straight removal
The removal assumed a generic change log (PaperTrail versions at the time; Ahoy events now that #2245 pivoted) covers what the bespoke log holds. It doesn't:
Field on scholarship_agreement_responses |
On a generic change log? |
|---|---|
status transition |
✅ agreement_response_status before/after |
responded_at |
⚠️ only the event timestamp, which isn't the same field |
responder (recipient / admin / system) |
❌ domain role, not the acting user |
reason (decline free text) |
❌ never stored on the scholarship |
amount_cents at the time of response |
❌ point-in-time value |
Scholarship#latest_agreement_response is a live read dependency: the responded-at date and decline reason are not columns on scholarship, so the UI has no other source.
Worse, per #2351 a logged-out recipient accepting or declining on the public callout produces no Ahoy event at all — the bespoke log is currently the only record that it happened.
Current surface
Scholarship:has_many :agreement_responses,after_create/after_update :log_agreement_response,latest_agreement_responseapp/views/scholarships/_agreement_history.html.erb, rendered byscholarships/editandevents/callouts/scholarship(admin-styled)ScholarshipAgreementResponse+scholarship_agreement_responsestable- Specs:
scholarship_agreement_response_spec, plus agreement-history coverage inscholarship_specandevents/callouts_spec
Recommendation
Keep the table; treat the follow-up as de-duplicating the UI, not deleting the log.
- Fix #2351 first, so recipient responses are tracked at all.
- Decide where
reason/responder/ point-in-timeamount_centslive if the table goes. If the answer is "on the scholarship", that's a schema change plus a backfill — bigger than the removal it was meant to simplify. - If the goal is just "one history UI per record", drop
_agreement_historyin favour of the shared activity log only once the generic log carries those fields.
Acceptance
Either a decision recorded here to keep the table (and the duplicate-UI question settled), or a plan that names the new home for every field in the table above, with a backfill.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with #2351, then inspect Scholarship, ScholarshipAgreementResponse, app/views/scholarships/_agreement_history.html.erb, and the listed specs to understand the current log and UI dependencies. Done means recording a decision to keep the table and settle the duplicate UI question, or naming a new home for every field with a backfill plan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend, database
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100