Skip to content

Test ParameterFilter#filter with empty filters returns a dup - #57556

Merged
fatkodima merged 1 commit into
rails:mainfrom
hammadxcm:test-parameter-filter-empty-dup
Jun 3, 2026
Merged

fatkodima merged 1 commit into
rails:mainfrom
hammadxcm:test-parameter-filter-empty-dup

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

When constructed with no filters, ActiveSupport::ParameterFilter#filter takes a fast path that returns params.dup rather than the same object. filter_param was tested for the empty-filters case, but #filter was not.

This adds coverage asserting the result is equal to but not the same object as the input. No production code changes — test-only.

When constructed with no filters, ParameterFilter#filter returns a dup
of the params rather than the same object. filter_param was tested for
the empty-filters case but #filter was not.

Add coverage asserting the result is equal but not the same object.
@fatkodima
fatkodima merged commit 597dac1 into rails:main Jun 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants