Show captured question wording for historical form answers#1701
Open
maebeale wants to merge 1 commit into
Open
Show captured question wording for historical form answers#1701maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
Editing a question's name later was retroactively relabeling answers that were already submitted, misrepresenting what each respondent was actually asked. Render the wording snapshotted at submission time (question_name_when_answered) instead, falling back to the field's current name only when no snapshot exists. Centralize this in a display_question_label helper so every submission view stays consistent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale
commented
Jun 16, 2026
| # back to the field's current name when there's no answer on file — e.g. a | ||
| # question added after this person submitted. | ||
| def display_question_label(field, response) | ||
| response&.question_name_when_answered.presence || field&.name |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Fallback to the live field.name is intentional but means answers predating the question_name_when_answered column (blank snapshot) still show the current wording — there's no backfill, only forward capture.
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.
What is the goal of this PR and why is this important?
When a question's name is edited later, historical submission views were retroactively relabeling already-submitted answers, misrepresenting what each respondent was actually asked. This PR makes every submission view render the wording snapshotted at submission time so editing a question no longer rewrites history.
How did you approach the change?
Added a
display_question_label(field, response)helper that returnsquestion_name_when_answered(the wording captured when the answer was saved), falling back to the field's current name only when no snapshot exists (e.g. a question added after this person submitted). Wired it into the public registration show, recipients, form submission, and scholarship submission views so the logic is centralized and consistent.UI Testing Checklist
Anything else to add?
Note: answers created before the
question_name_when_answeredcolumn existed have a blank snapshot, so they still fall back to the current field name (no backfill). Covered by new helper and request specs.