Registration ticket cleanup: dead code, N+1, constant homes, missing specs#1999
Merged
Merged
Conversation
… 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>
7bd1e31 to
8df0b2c
Compare
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 📖 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.
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 viacompleted_day_N.registration_ticket_calloutswas queried twice per ticket render (once in the view, once inBuiltinCalloutCards#materialized?), plus aresources.any?query per visible callout. Now preloaded and read from the loaded association.HANDOUT_RESOURCE_TITLESfromEvents::CalloutsControllerintoBuiltinCallouts, which actually owns the callout catalog.BuiltinCallouts.seedable_keys— confirmed zero callers anywhere.CalloutsController's three previously-uncovered actions (certificate,update_ce_license,request_ce).config_gapbypass 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/lintclean on all touched filesai/security(brakeman) clean, no new warnings