Skip to content

Drop the mayoral pick from the resident survey - #130

Merged
mikaalnaik merged 1 commit into
mainfrom
mikaal/remove-mayor-vote-question
Sep 10, 2026
Merged

mikaalnaik merged 1 commit into
mainfrom
mikaal/remove-mayor-vote-question

Conversation

@mikaalnaik

Copy link
Copy Markdown
Contributor

Removes the "Who do you plan to vote for as mayor?" question (mayor_vote) from the Toronto resident survey definition. "About you" is now email + postal code; 31 questions remain.

The mayoral_candidates options_source machinery (Warehouse::Election#mayoral_candidate_options and the question-model support) stays in place — it's generic and still covered by tests, so another election can ask the question without rebuilding it.

Merging this does not remove it from prod

The seed JSON is a restore record, not a live source of truth — the database is authoritative once seeded. After merge, the question keeps serving from /api/v1/.../surveys until one of:

  • bin/rails db:seed runs (the seeder destroys questions no longer in the definition), or
  • the question is deleted in the admin CMS.

Note that re-running the seed also overwrites any CMS edits to the questions it names, so the CMS delete is the lighter-touch option.

Testing

bin/rails test test/tasks/elections_seed_test.rb test/models/warehouse/election_survey_test.rb test/controllers/api/v1/election_surveys_controller_test.rb — 28 runs, 0 failures.

🤖 Generated with Claude Code

The "Who do you plan to vote for as mayor?" question comes out of the
Toronto resident survey definition, leaving "About you" as email and
postal code.

The mayoral_candidates options_source machinery stays: it is generic and
still tested, so another election can ask the question without rebuilding
it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

The PR removes the required mayoral-choice question from the Toronto resident survey definition, leaving email and postal code in the “About you” step.

  • Removes the mayor_vote select question and its mayoral_candidates option source from this survey.
  • Preserves the remaining question positions and the generic candidate-option machinery elsewhere.
  • The live database remains unchanged until an operator deletes the question through the CMS or reruns the seed.

Confidence Score: 5/5

The PR appears safe to merge; the survey API and its known frontend consumer both handle the question set dynamically.

The change is limited to removing one seed-defined question, and no fixed question-count, required-field, or cross-repository consumer contract was found that depends on mayor_vote.

Important Files Changed

Filename Overview
db/seeds/elections/toronto_2026_city_priorities.json Cleanly removes the mayoral-choice question without disturbing the remaining survey definition.

Reviews (1): Last reviewed commit: "Drop the mayoral pick from the resident ..." | Re-trigger Greptile

@mikaalnaik
mikaalnaik merged commit e37bd94 into main Sep 10, 2026
4 checks passed
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