rubyforgood / rubyforgood/awbw
Writes that skip callbacks leave no event: update_all, update_columns, dependent: :nullify
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 15
- Forks
- 26
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 242
Description
🤖 From Claude:
AhoyTrackable hangs off after_create / after_update / after_destroy, so any write that bypasses callbacks is invisible. Distinct from #2351 (which is about who is acting) — here the callback never runs at all.
Where it bites
dependent: :nullify is an update_all. Destroying a parent silently rewrites its children:
- destroying an
EventRegistrationre-points itsnotificationsandaffiliations - destroying a
FormFieldorphans everyform_answer - destroying an
Addressnullifies the affiliations pointing at it
The destroy of the parent is recorded. The rewrite of the children isn't, so the children's history shows nothing where the data changed under them.
Direct column writes:
SectorsTaggableresets the primary flag withupdate_all(sectors_taggable.rb:52)Affiliationsyncs org columns withupdate_columns(affiliation.rb:191)story_share_admin_controllerreorders withupdate_columns
Recommendation
Don't chase every call — most are deliberate (that's why they skip callbacks). Fix the ones where the silence misleads:
- Registration transfer / deletion — the affiliation and notification re-pointing is exactly the kind of thing an admin later asks about.
- Form field deletion — answers changing shape without a trace is a data-integrity story, not just an audit one.
For those, either record an explicit event where the write happens, or replace the bulk write with per-record saves where the volume is small enough (it is, in both cases).
Acceptance
Destroying a registration leaves a record of what happened to its affiliations and notifications — either on their own history or on the registration's.
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 the dependent associations for EventRegistration and FormField, then inspect the cited write sites: sectors_taggable.rb:52, affiliation.rb:191, and story_share_admin_controller. Trace how history events are recorded around registration deletion and form-field deletion. Done means destroying a registration records the resulting affiliation and notification changes, with the form-field case also leaving a trace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100