Create a copy before modifying to avoid modifying the cached filter

This commit is contained in:
Jason Zimdars
2025-09-09 22:45:46 -05:00
parent 0449396aea
commit 4e50609d2b
+1 -1
View File
@@ -64,7 +64,7 @@ module Filter::Params
end
def as_params_without(key, value)
as_params.tap do |params|
as_params.dup.tap do |params|
if params[key].is_a?(Array)
params[key] = params[key] - [ value ]
params.delete(key) if params[key].empty?