Created
March 20, 2014 19:21
-
-
Save renato-zannon/9671738 to your computer and use it in GitHub Desktop.
Fix rails 2.3 filter_parameter_logging for ruby 2.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The filter_parameter_logging method, used to filter request parameters | |
# (such as passwords) from the log, defines a protected method called | |
# filter_parameter when called. Its existence is later tested using | |
# respond_to?, without the include_private parameter. Due to the respond_to? | |
# behavior change, the method existence is never detected, and parameter | |
# filtering stops working. | |
require 'action_controller' | |
module ParameterFilterPatch | |
def respond_to?(method, include_private = false) | |
if method.to_s == 'filter_parameters' | |
include_private = true | |
end | |
super(method, include_private) | |
end | |
end | |
module ActionController | |
class Base | |
prepend ParameterFilterPatch | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are a saint Renato!