rubyforgood / rubyforgood/awbw
Rename organization_status → program_status, then rip out the stored field for computed program status
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 15
- Forks
- 26
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 242
Description
🤖 From Claude: Captured from a working session on #1993 (org index/profile program-status rework). Two follow-ups, in order.
Phase 1 — rename organization_status → program_status in code (no behavior change)
The org's status concept is really its program status. Rename for clarity while keeping the stored field:
- Model:
belongs_to :organization_status,organization_status_idcolumn,OrganizationStatusmodel +OrganizationStatusDecorator, the/organization_statusesadmin CRUD,PROGRAM_STATUS_BUCKETS. - Decorator:
organization_status_bucket/organization_status_label/organization_status_classes/organization_status_chip. - Scope/params/filter:
Organization.program_statusscope (already named),program_statusfilter param,organization_status_idin strong params,@organization_statuses. - Note:
EventRegistration's look-alike was already renamed toorganization_linking_status— leave it. - Mostly mechanical; do it as its own PR so the diff is reviewable.
Phase 2 — rip out the stored field; program status becomes fully computed
Program status is already computed from facilitator affiliations and only falls back to the stored status in two places (both already isolated for exactly this):
OrganizationDecorator#organization_status_bucket— delete the "else → stored bucket" fallback branch.Organization.program_statusscope — delete the "OR stored-status" half.
Then remove the field's ecosystem:
- Migration: drop
organizations.organization_status_id(+ FK) and theorganization_statusestable. - Delete
OrganizationStatus+OrganizationStatusDecorator; removebelongs_to+validates :organization_status_id, presence. - Delete the
/organization_statusesadmin CRUD (controller, 5 views, policy, routes) and the "Organization statuses" card inadmin_cards_helper. - Delete the affiliation sync callbacks (
sync_organization_status_with_affiliations,deactivate_organization_if_no_active_people,reactivate_organization_if_inactive) — keepsync_organization_affiliation_dates(dates, not status). - Remove status from seeds (
db/seeds.rb,db/seeds/dev/organizations.rb,db/seeds/dev/events_management.rb), the org factoryassociation :organization_status, and theorganization_statusfactory. - Edit form: remove the status
select+facilitator_status_name/status_matches_affiliations/show_status_select+ hidden field. event_registrations_controllerOrganization.create!(…, organization_status: …)— drop the arg.organizations_results.html.erbstatus_label(shows the stored name on unpublished orgs) — rework/remove.- Specs / AGENTS.md — drop everything referencing
OrganizationStatus.
Decision made this session
Organization.active / published? (org public visibility) currently means "status Active OR any active affiliation." When the field is removed, it should mean an active facilitator affiliation (i.e., program-status Active). This is the load-bearing/risky change — it changes which orgs are publicly visible.
Before dropping
Export/backfill the manual Pending / Suspended values first if anyone wants that history — the column drop discards them.
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
Begin by tracing OrganizationDecorator#organization_status_bucket, the Organization.program_status scope, and the active/published visibility behavior described in the issue. Review the listed models, controllers, views, seeds, factories, routes, policies, migration, and specs before separating the mechanical rename from field removal. Done means the stored status ecosystem is removed, computed facilitator status remains correct, visibility behavior is covered, and the test suite passes.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100