Skip to content

Commit

Permalink
Move config.filter_parameters to you own initializer file
Browse files Browse the repository at this point in the history
This is very rarely changed and does not deserve to be in application.rb
  • Loading branch information
rafaelfranca committed Jan 5, 2013
1 parent 89979ca commit fe3f043
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Expand Up @@ -23,9 +23,6 @@ class Application < Rails::Application
# Custom directories with classes and modules you want to be autoloadable. # Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras) # config.autoload_paths += %W(#{config.root}/extras)


# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]

# Use SQL instead of Active Record's schema dumper when creating the database. # Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper, # This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types. # like if you have constraints or database-specific column types.
Expand Down
@@ -0,0 +1,2 @@
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
4 changes: 2 additions & 2 deletions railties/test/application/configuration_test.rb
Expand Up @@ -193,8 +193,8 @@ def teardown
end end


test "filter_parameters should be able to set via config.filter_parameters in an initializer" do test "filter_parameters should be able to set via config.filter_parameters in an initializer" do
app_file 'config/initializers/filter_parameters.rb', <<-RUBY app_file 'config/initializers/filter_parameters_logging.rb', <<-RUBY
Rails.application.config.filter_parameters += [ :foo, 'bar' ] Rails.application.config.filter_parameters += [ :password, :foo, 'bar' ]
RUBY RUBY


require "#{app_path}/config/environment" require "#{app_path}/config/environment"
Expand Down

0 comments on commit fe3f043

Please sign in to comment.