rubyforgood / rubyforgood/awbw
Resources ↔ Organization: follow-ups after PR #2421
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 15
- Forks
- 26
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 242
Description
🤖 From Claude: filed on behalf of @maebeale to track the open items from PR #2421.
PR #2421 gave resources a real Organization link (resources.organization_id FK + belongs_to :organization), replacing the legacy free-text resources.agency name, and added a one-time resolve script (.context/resolve_resource_organizations.rb) that matches/creates an org by exact name. Three follow-ups were deliberately left out of that PR:
1. Enrich created orgs with the resource's filemaker_code
When the resolve pass creates a new Organization (no name match), it currently sets name + Active status only. Resources also carry a filemaker_code, and FileMaker code is the org source-of-truth (matched by set-intersection elsewhere). Decide whether a newly-created org should inherit resource.filemaker_code so it's dedup-able later.
- Trade-off: richer data + better future matching vs. importing a code we didn't match on.
2. Org picker on the resource form
resources.agency was never form-editable, and no org picker was added — so new resources still won't set an organization until we add that UI. Add an Organization select to the resource form (admin) if we want new resources linked at creation time.
3. Drop the resources.agency column (after the resolve pass runs)
The agency column is kept for now so the resolve script can read it. Once the resolve pass has run in prod, drop the column in a follow-up reversible migration.
- Sequencing: run the resolve pass in prod → confirm counts → then drop
agency.
Context: PR #2421 · resolve script lives at .context/resolve_resource_organizations.rb (gitignored — dry-run first, idempotent).
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 by reading PR #2421 and .context/resolve_resource_organizations.rb, running its dry-run as documented, and reviewing how resource forms and Organization records are handled. Clarify the filemaker_code decision, add the admin Organization picker, and confirm the production resolve counts before preparing the reversible migration that removes agency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100