WAIT: Sync registration "Other" organization type onto the linked org#1875
Draft
maebeale wants to merge 1 commit into
Draft
WAIT: Sync registration "Other" organization type onto the linked org#1875maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
Why: a registrant who picked "Other" for organization type had nowhere to record what that "other" was, and the org's agency_type_other column was only ever set from the admin edit form. Make the registration "Other" choice behave like every other specify option (reveals a box, stores "Other: <text>") and mirror the answer onto the linked organization so the free text isn't lost. Latest registration wins; AhoyTrackable records the before/after on each update. No data migration — new behavior applies to forms built after this change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale
commented
Jun 22, 2026
| # wins; AhoyTrackable records the before/after on the update. | ||
| def update_agency_type(organization) | ||
| raw = field_value("agency_type").to_s.strip | ||
| label, _separator, specified = raw.partition(":") |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: partition(":") is safe here because none of the agency-type option labels contain a colon, so the split always yields the option label and (for "Other") the typed free text. agency_type_other is cleared for non-"Other" choices to avoid leaving stale text behind.
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.
🤖 PR, suggested 👤 review level: 📖 Read — light-logic: small specify-option change plus a guarded org write, no migration
What is the goal of this PR and why is this important?
"Other: <text>"), and the answer is mirrored onto the linked organization’sagency_type/agency_type_other.How did you approach the change?
form_builder_service.rb: the agency-type option is now bare"Other", which auto-qualifies as a generic specify option (no extra wiring).organizations/_form.html.erb: org edit select now offers"Other"so the synced value renders selected.public_registration.rb: newupdate_agency_typesplits the answer — option label →agency_type, stripped free text →agency_type_other(cleared for non-Other choices). Latest registration wins;AhoyTrackablerecords before/after on each update, so prior values are auditable.Anything else to add?
"Other (please specify below)"option until re-seeded.