最も簡単な方法は、Rails コードにモンキーパッチを適用してパラメーター フィルタリングを行うことだと思いますconfig/initializers/filter_parameter_logging.rb
。
# monkeypatch to filter nested parameters
class ActionDispatch::Http::ParameterFilter::CompiledFilter
def call(original_params, path = [])
filtered_params = {}
original_params.each do |key, value|
if regexps.any? { |r| key =~ r || (path + [key]).join('/') =~ r }
value = ActionDispatch::Http::ParameterFilter::FILTERED
elsif value.is_a?(Hash)
value = call(value, path + [key])
elsif value.is_a?(Array)
value = value.map { |v| v.is_a?(Hash) ? call(v, path + [key]) : v }
elsif blocks.any?
key = key.dup
value = value.dup if value.duplicable?
blocks.each { |b| b.call(key, value) }
end
filtered_params[key] = value
end
filtered_params
end
end
その後:
Rails.application.config.filter_parameters += ['download/data']