Disable ActiveRecord parameter filtering

Viewed 278

I'm using Rails 6 and it's automatically filtering columns on my ActiveRecord models that have the word token in them. I appreciate that, but these columns are not sensitive.

I've searched around but cannot find how I can permit these fields from being displayed in my console or logs.

Thanks!

1 Answers

By default, when you create a new Rails app this template will be used to create an initializer called config/initializers/filter_parameter_logging.rb. You can edit the Rails.application.config.filter_parameters values that are configured in this file. You'll need to restart the app after making changes.

Rather than just remove :token from the list, you might want to change that to :authenticity_token so that you still filter out the Rails authenticity token.

Related