Skip to content

Registration ticket cleanup: dead code, N+1, constant homes, missing specs#1999

Merged
maebeale merged 1 commit into
mainfrom
maebeale/registration-ticket-assessment
Jul 15, 2026
Merged

Registration ticket cleanup: dead code, N+1, constant homes, missing specs#1999
maebeale merged 1 commit into
mainfrom
maebeale/registration-ticket-assessment

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 small, contained fixes with low blast radius, no schema changes

Summary

Follow-up from a full assessment of the registration ticket / callout feature's history and current code.

  • Removes EventRegistration#checked_in? — a stub with no backing column and no trace of ever being built out; the "Checked in" ticket badge branch was unreachable dead code. Day 1/Day N attendance already covers this need via completed_day_N.
  • Fixes a real N+1: registration_ticket_callouts was queried twice per ticket render (once in the view, once in BuiltinCalloutCards#materialized?), plus a resources.any? query per visible callout. Now preloaded and read from the loaded association.
  • Moves HANDOUT_RESOURCE_TITLES from Events::CalloutsController into BuiltinCallouts, which actually owns the callout catalog.
  • Deletes BuiltinCallouts.seedable_keys — confirmed zero callers anywhere.
  • Adds request specs for CalloutsController's three previously-uncovered actions (certificate, update_ce_license, request_ce).
  • Adds a spec pinning that the sample-ticket preview's config_gap bypass only applies to scholarship/CE (registrant-level), never payment/videoconference (event-level) — guards against a repeat of the Guard payment/scholarship/CE ticket callouts against missing event config #1992/Consolidate CE + art supplies callouts onto rows; drop legacy Event columns #1996 regression.

Test plan

  • ai/lint clean on all touched files
  • Full relevant spec suite green (688 examples, 0 failures)
  • ai/security (brakeman) clean, no new warnings

Copilot AI review requested due to automatic review settings July 15, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

… specs

- Remove EventRegistration#checked_in? — a stub with no backing column and
  no history of ever being implemented; deletes the unreachable "Checked in"
  badge branch on the ticket too. Day 1/Day N attendance already covers this
  via completed_day_N.
- Fix a real double-query on every ticket render: registration_ticket_callouts
  was queried once in the view and again in BuiltinCalloutCards#materialized?,
  plus a resources.any? query per visible callout. Preload
  event: { registration_ticket_callouts: :resources } and read the loaded
  association in Ruby instead of re-scoping it.
- Move HANDOUT_RESOURCE_TITLES from Events::CalloutsController into
  BuiltinCallouts, which actually owns the callout catalog; the controller
  had it backwards.
- Delete BuiltinCallouts.seedable_keys — dead code with no callers anywhere.
- Add request specs for CalloutsController's three previously-uncovered
  actions (certificate, update_ce_license, request_ce), and a spec pinning
  that the sample-ticket preview's config_gap bypass only applies to
  scholarship/CE (registrant-level), never payment/videoconference
  (event-level) — guards against a repeat of the #1992/#1996 regression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/registration-ticket-assessment branch from 7bd1e31 to 8df0b2c Compare July 15, 2026 12:12
Copilot AI review requested due to automatic review settings July 15, 2026 12:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale marked this pull request as ready for review July 15, 2026 12:15
@maebeale maebeale merged commit 57a36a4 into main Jul 15, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/registration-ticket-assessment branch July 15, 2026 12:18
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.

2 participants