Skip to content

Rename service-area field identifiers and references to sector#1755

Open
maebeale wants to merge 1 commit into
mainfrom
maebeale/rename-service-area-to-sector
Open

Rename service-area field identifiers and references to sector#1755
maebeale wants to merge 1 commit into
mainfrom
maebeale/rename-service-area-to-sector

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

What is the goal of this PR and why is this important?

  • The professional-info "Primary/Additional service area" questions are really about sectors — their options come from the Sectors admin and Rename service-area form fields to sectors and refine sector questions #1750 already renamed the user-facing labels to "Primary sector" / "Additional sectors".
  • This finishes that rename by aligning the underlying code so identifiers, constants, methods, and copy all consistently say "sector".

How did you approach the change?

  • Renamed the persisted form field identifiers (primary_service_areaprimary_sector, primary_service_area_singleprimary_sector_single) and the constants/methods/locals/comments that referenced "service area" across models, helpers, services, views, seeds, and specs.
  • Added a reversible data migration that renames the field_identifier values on existing FormField records (the column is persisted and indexed), so dashboards, the recipients page, and public registration keep resolving sectors for forms already in the database.

UI Testing Checklist

  • Public registration form renders the "Primary sector" / "Additional sectors" questions and saves selections as sector tags.
  • Event recipients page and Background charts still show each registrant's sector(s).
  • Person profile shows free-text "Other" sector chips.

Anything else to add?

  • Pure rename — no behavior change. RuboCop is clean and the affected specs (430 examples) pass.

@maebeale maebeale marked this pull request as ready for review June 18, 2026 19:57
}.freeze

def up
IDENTIFIER_RENAMES.each do |old_identifier, new_identifier|

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: field_identifier is a persisted, indexed column, so existing FormField records need this bulk rename — without it, forms already in the DB would keep the old identifier and silently lose their dynamic sector options. Reversible via down.

@maebeale maebeale force-pushed the maebeale/rename-service-area-to-sector branch from b9c2fc3 to 644a96e Compare June 18, 2026 20:01
The professional-info "Primary/Additional service area" questions are
really about sectors — their options come from the Sectors admin — so the
underlying form field identifiers, constants, methods, and seed/spec
references are renamed to match the user-facing "sector" wording introduced
in #1750. A data migration renames the persisted field_identifier values on
existing FormField records so dashboards and registration keep working.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/rename-service-area-to-sector branch from 644a96e to f4e483c Compare June 18, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant