Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a check for filter_parameter_logging

  • Loading branch information...
commit 23d099e9b1eff83ef7737b24d133e1b379819aa0 1 parent 6d5d641
Dominik Masur dmasur authored
Showing with 21 additions and 0 deletions.
  1. +14 −0 lib/application_checker.rb
  2. +7 −0 test/application_checker_test.rb
14 lib/application_checker.rb
View
@@ -358,6 +358,20 @@ def check_old_action_mailer_send_on_setting
)
end
end
+ def check_old_filter_parameter
+ files = []
+ lines = grep_for("filter_parameter_logging", "app/controllers/*")
+ files += extract_filenames(lines) || []
+
+ unless files.empty?
+ alert(
+ "Deprecated filter_parameter_logging calls",
+ "The list of filtered parameters are now stored in /config/application.rb. For example: config.filter_parameters += [:password]",
+ "http://de.asciicasts.com/episodes/224-controller-in-rails-3",
+ files
+ )
+ end
+ end
private
def grep_for_with_perl_regex(text, where = "./", double_quote = false)
grep_for(text, where, double_quote, true)
7 test/application_checker_test.rb
View
@@ -304,6 +304,13 @@ def test_check_old_ajax_helpers
assert @checker.alerts.has_key?("Deprecated AJAX helper calls")
end
+
+ def test_check_old_ajax_helpers
+ make_file("app/controllers", "application_controller.rb", "filter_parameter_logging :password")
+ @checker.check_old_filter_parameter
+
+ assert @checker.alerts.has_key?("Deprecated filter_parameter_logging calls")
+ end
def test_check_old_ajax_helpers_empty
@checker.check_old_ajax_helpers
Please sign in to comment.
Something went wrong with that request. Please try again.