Skip to content

Commit 46f2c6e

Browse files
authored
Provide a working example for a filter_parameters lambda
The one provided wouldn't actually change the value in the logs. Based on https://github.com/rails/rails/blob/48ca9e2557d18a01fb3f6002645363f8dea28019/actionpack/lib/action_dispatch/http/filter_parameters.rb#L26
1 parent 48ca9e2 commit 46f2c6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

railties/test/application/configuration_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ class Comment < ActiveRecord::Base
468468
test "filter_parameters should be able to set via config.filter_parameters" do
469469
add_to_config <<-RUBY
470470
config.filter_parameters += [ :foo, 'bar', lambda { |key, value|
471-
value = value.reverse if /baz/.match?(key)
471+
value.reverse! if /baz/.match?(key)
472472
}]
473473
RUBY
474474

0 commit comments

Comments
 (0)