Skip to content

Rename organization_status β†’ program_status, then rip out the stored field for computed program statusΒ #2065

Description

@maebeale

πŸ€– 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):

  1. OrganizationDecorator#organization_status_bucket β€” delete the "else β†’ stored bucket" fallback branch.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions