[Views] Pass card, card grant and transfer ivars to partials as strict locals - #15205
Open
Luke-Oldenburg wants to merge 2 commits into
Open
Luke-Oldenburg wants to merge 2 commits into
Luke-Oldenburg wants to merge 2 commits into
Conversation
…t locals The stripe card and card grant partials, events/_card_grant_actions, _event_cards_table and _unauthorized_callout, and events/transfers/_modal and _form now take the ivars they read as declared locals. _unauthorized_callout gets event from every transfer form that renders it, including the payment and payroll forms. card_grants/_create_form's defined?(@Popover) && @Popover becomes a check on the popover local. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 1, 2026
Open
Open
…ard local stripe_cards/_actions and actions/_rename got stripe_card: @card and card: @card, the same object under two names, only so _rename could pass card on to _name_form. _rename now passes card: stripe_card, and both partials go back to declaring just stripe_card:. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
Note
This is one PR in a stack split out of #15191. Review and merge them in order. Each PR's base branch is the PR before it, so its diff shows only its own change.
local_assigns@eventand row options through navs and transaction rows as strict localsSummary of the problem
Partials read instance variables that the controller, or the template rendering them, happened to set. Those inputs don't appear in the partial's strict locals declaration from #15191, nothing checks that a caller provides them, and a partial rendered from a page that didn't set the ivar silently gets
nil.This part of the stack turns each ivar a partial reads into a declared local that its callers pass. It was the fourth commit on #15191 (324 files), split by area so each part can be reviewed on its own. With every PR merged, the code is that commit's, except in three partials that got the same object under two names. Those now read the local they already had (in #15205, #15206 and #15208).
Describe your changes
_stripe_card,_details,_form,_name_form,_shipping,_actionsandactions/_rename._actions,_buttons,_card_details,_create_form,_create_modal,_edit_navand theactions/*partials, plusevents/_card_grant_actionsandevents/_event_cards_table.events/transfers/_modaland_form, andevents/_unauthorized_callout, which getseventfrom every transfer form that renders it (ACH, check, PayPal, wire, Wise, payments, contractors and grants).card_grants/_create_form'sdefined?(@popover) && @popoveris now a plain check on thepopoverlocal.stripe_cards/_name_formreadscard, whichstripe_cards/editpasses from@card.stripe_cards/actions/_renamepasses itcard: stripe_card, so_actionsand_renamestill declare onlystripe_card:(second commit).How each conversion works
x: @x. A partial in between passes its own local along. Where a partial already had a local holding the same object, it reads that local instead of getting a second copy.nil.nil-default ones, so no partial falls back to a default the ivar didn't have.Testing
main.main, anderb_lintreports no offenses. I rendered every stripe card's show and edit page and the organizer removal form for 15 organizer positions before and after folding them, with the dev DB's cards temporarily set active so the rename modal and the active-card warning render. The HTML is identical.🤖 Generated with Claude Code