Canonicalize sector/age field naming; drop dead agency_type mapping - #2278
Merged
Conversation
Drop the legacy alias now that primary_sector is the canonical primary sector identifier. Merge only after prod form data is migrated from primary_sector_single → primary_sector (see the connected issue). With no legacy identifiers left, the legacy_form_identifiers dev seed and its rake task go too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The canonical identifier is additional_sectors (plural, multi-select), so the spec-local hash key, let, and ids[] references should read plural too — a singular "additional_sector" label reads as one sector for a many-sector field. Names now match the value's number. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale
force-pushed
the
maebeale/remove-primary-sector-single
branch
from
August 30, 2026 11:46
cc537df to
8451ed5
Compare
maebeale
marked this pull request as ready for review
August 30, 2026 11:47
Matches the plural canonical identifier (additional_age_groups) the let already creates — same tidy as the professional-fields spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The old Ahoy events written with the pre-rename agency_type property have been removed, so nothing stamps that column name anymore — the dual mapping and its test are dead. organization_type is now the only source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The additional-sectors field is multi-select, so its dashboard aggregates (count / ids / registrant_ids) and the adjacent registration local now read plural, matching the canonical additional_sectors identifier. primary_sector_* stays singular — that field is single-select. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
organization_name is the only identifier read for the org-name answer now (the agency_name alias is long gone), so "canonical or legacy" misleads. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 suggested review level: 3 Read 📖 mostly mechanical renames, but touches dashboard aggregate methods + a live label map — worth a read
Finishes the sector/age identifier cleanup so the codebase uses only canonical values, and removes a now-dead legacy mapping.
primary_sector_singlelegacy identifier — already shipped in main via #2419. After rebasing, this PR is the leftover naming cleanup + a canonical-value sweep.Naming: match the canonical identifiers
The multi-select fields are plural (
additional_sectors,additional_age_groups); the single-select ones stay singular (primary_sector,primary_age_group). Internal names now follow suit.additional_sector→additional_sectors(professional-fields spec);additional_age_group_field→additional_age_groups_field(dashboard spec).EventDashboardaggregates:additional_sector_count/_ids/_registrant_ids→additional_sectors_*(and their call sites indashboard/rosterviews + the adjacent registration local).primary_sector_*stays singular.form_field.rb: reworded thePRIMARY_SECTOR_FIELD_IDENTIFIERScomment to singular — it holds one identifier now.Remove dead legacy mapping
agency_type→ "Type" entry (and its test) fromFormSubmissionChanges. It existed only for old Ahoy events written before theagency_type→organization_typecolumn rename; those events have been removed, so nothing stamps that property anymore.Sweep result
Swept for lingering legacy identifiers from the recent renames — all data-coupled conversions are complete. No legacy identifier strings remain in live code, specs, or seeds (
payer_*form fields,agency_*,primary_service_area, singularadditional_age_group— all gone; remainingpayer_*is the Payment model's own domain).