Skip to content

Only show the impound update action for the org's own record - #4006

Merged
sethherr merged 3 commits into
mainfrom
sethherr/create-pr-v3
Jul 31, 2026
Merged

Only show the impound update action for the org's own record#4006
sethherr merged 3 commits into
mainfrom
sethherr/create-pr-v3

Conversation

@sethherr

@sethherr sethherr commented Jul 31, 2026

Copy link
Copy Markdown
Member

A staff member at an impound_bikes org viewing an impounded bike got the Update Impound Record action no matter who impounded it — the form then pointed into their org's impound routes, which the record isn't in. An unorganized impound record has a nil display_id by design, so organization_impound_record_path couldn't build a URL at all and the registration page 500'd (133103079).

  • Both the action button and its panel now require current_impound_record.organization_id to match the viewing org. Another org's record silently pointed at a display_id the org's friendly_find! would 404 on, so that case was broken too, just more quietly.
  • The wrapper preview's impounded bike carries an impound record now, so the preview renders the update panel it's meant to show.

sethherr and others added 3 commits July 31, 2026 08:50
The org-admin top actions rendered the impound update panel for any
impounded bike, so a staff member at an impound_bikes org viewing a bike
impounded by someone else got a form pointing into their own org's
routes. An unorganized impound record has no display_id, so building that
URL raised UrlGenerationError and 500'd the registration page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The impound update guard changed markup inside the cached fragment.

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

Copy link
Copy Markdown
Member Author

Screenshots

/rails/view_components/registrations/show/org_top_actions/wrapper/component/default?panel=impound_update

The preview's impounded bike now carries an impound record, so the update panel renders. On main the same action button activates and opens nothing — the panel it points at never rendered.

Desktop Mobile
main - the impound update action opens an empty panel main mobile
main 👆 this branch 👇
this branch - the update form renders this branch mobile

@sethherr
sethherr marked this pull request as ready for review July 31, 2026 16:48
@sethherr
sethherr merged commit 7d5a457 into main Jul 31, 2026
9 checks passed
@sethherr
sethherr deleted the sethherr/create-pr-v3 branch July 31, 2026 16:49
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