π€ 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_id column, OrganizationStatus model + OrganizationStatusDecorator, the /organization_statuses admin CRUD, PROGRAM_STATUS_BUCKETS.
- Decorator:
organization_status_bucket / organization_status_label / organization_status_classes / organization_status_chip.
- Scope/params/filter:
Organization.program_status scope (already named), program_status filter param, organization_status_id in strong params, @organization_statuses.
- Note:
EventRegistration's look-alike was already renamed to organization_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_status scope β delete the "OR stored-status" half.
Then remove the field's ecosystem:
- Migration: drop
organizations.organization_status_id (+ FK) and the organization_statuses table.
- Delete
OrganizationStatus + OrganizationStatusDecorator; remove belongs_to + validates :organization_status_id, presence.
- Delete the
/organization_statuses admin CRUD (controller, 5 views, policy, routes) and the "Organization statuses" card in admin_cards_helper.
- Delete the affiliation sync callbacks (
sync_organization_status_with_affiliations, deactivate_organization_if_no_active_people, reactivate_organization_if_inactive) β keep sync_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 factory association :organization_status, and the organization_status factory.
- Edit form: remove the status
select + facilitator_status_name/status_matches_affiliations/show_status_select + hidden field.
event_registrations_controller Organization.create!(β¦, organization_status: β¦) β drop the arg.
organizations_results.html.erb status_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.
π€ 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_statusin code (no behavior change)The org's status concept is really its program status. Rename for clarity while keeping the stored field:
belongs_to :organization_status,organization_status_idcolumn,OrganizationStatusmodel +OrganizationStatusDecorator, the/organization_statusesadmin CRUD,PROGRAM_STATUS_BUCKETS.organization_status_bucket/organization_status_label/organization_status_classes/organization_status_chip.Organization.program_statusscope (already named),program_statusfilter param,organization_status_idin strong params,@organization_statuses.EventRegistration's look-alike was already renamed toorganization_linking_statusβ leave it.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:
organizations.organization_status_id(+ FK) and theorganization_statusestable.OrganizationStatus+OrganizationStatusDecorator; removebelongs_to+validates :organization_status_id, presence./organization_statusesadmin CRUD (controller, 5 views, policy, routes) and the "Organization statuses" card inadmin_cards_helper.sync_organization_status_with_affiliations,deactivate_organization_if_no_active_people,reactivate_organization_if_inactive) β keepsync_organization_affiliation_dates(dates, not status).db/seeds.rb,db/seeds/dev/organizations.rb,db/seeds/dev/events_management.rb), the org factoryassociation :organization_status, and theorganization_statusfactory.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.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.