Use expect
for nested params in auth/setup#update
#33657
Merged
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.
Background: #33644 (comment)
I'd been planning to do some of these as a post-rails-8 thing, and that rubocop PR reminded me. I suspect they will add/expand the cop over time to catch more conditions ... and we actually have a lot less of these than I would have guessed, since much of the API controllers are not nested (ie, just have top-level
params.permit(...)
but not nested require/permit combo).For this first PR, I've done the simplest example I could find along with a spec to show what changes (prior to change, this would error out as 5xx response, post-change it's handled as 4xx due to invalid params).
Assuming we're good with the change and not worried about issues from the changing (but probably improved?) response codes, I'll do larger future batches, and/or just bulk autocorrect.