Skip to content

Fix UserParameters#without being a no-op#4

Merged
dylangriffinshub merged 1 commit into
mainfrom
fix-user-parameters-without-noop
Jul 17, 2026
Merged

Fix UserParameters#without being a no-op#4
dylangriffinshub merged 1 commit into
mainfrom
fix-user-parameters-without-noop

Conversation

@dylangriffinshub

Copy link
Copy Markdown
Owner

Mirrors the fix opened upstream at rubyforgood#7070. See that PR for full context.

#without compared symbol keys (its only caller, CreateCasaAdminService#build,
always passes symbols) against ActionController::Parameters#reject!'s
string keys, so the block condition was always false and nothing was
ever removed. It also didn't return self, breaking the builder chain.

This let :active and :type survive into CasaAdmin.new via
CreateCasaAdminService#build, letting any authenticated user set
active=false on a new admin, or trigger an unrescued
ActiveRecord::SubclassNotFound (500) by passing type=<sibling class>.

Fixes rubyforgood#7067

Also replaces the pending spec stub in spec/values/user_parameters_spec.rb
with real coverage of without, without_type, without_active,
with_organization, and with_password.
@dylangriffinshub
dylangriffinshub merged commit 8123fb7 into main Jul 17, 2026
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