I\'m working on upgrading from Rails 2.3.11 to 3.0.10, and am having trouble converting what is in the ApplicationController
\'s filter_parameter_logging
Figured it out. You can pass a lambda statement to config.filter_parameters
, so after I add the parameters to filter, I have this now:
config.filter_parameters << lambda do |k,v|
begin
# Bail immediately if we can
next unless v =~ FILTER_WORDS_REGEX && (v.index("=") || v.index("%3D"))
#Filters out values for params that match
v.gsub!(FILTER_WORDS_GSUB_REGEX) do
"#{$1}=[FILTERED]#{$2}"
end
rescue Exception => e
logger.error e
end
end