Module: Bugsnag::Rails::ActionControllerRescue::ClassMethods
- Defined in:
- lib/bugsnag/rails/action_controller_rescue.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#filter_parameter_logging_with_bugsnag(*filter_words, &block) ⇒ Object
Rails 2 does parameter filtering via a controller configuration method that dynamically defines a method on the controller, so the configured parameters aren’t easily accessible.
Class Method Details
.extended(base) ⇒ Object
50 51 52 53 54 |
# File 'lib/bugsnag/rails/action_controller_rescue.rb', line 50 def self.extended(base) base.singleton_class.class_eval do alias_method_chain :filter_parameter_logging, :bugsnag end end |
Instance Method Details
#filter_parameter_logging_with_bugsnag(*filter_words, &block) ⇒ Object
Rails 2 does parameter filtering via a controller configuration method that dynamically defines a method on the controller, so the configured parameters aren’t easily accessible. Intercept these parameters as they’re configured so that the Bugsnag configuration can take them into account.
62 63 64 65 66 67 68 69 70 |
# File 'lib/bugsnag/rails/action_controller_rescue.rb', line 62 def filter_parameter_logging_with_bugsnag(*filter_words, &block) if filter_words.length > 0 Bugsnag.configure do |config| # Use the same regular expression that Rails parameter filtering uses. config.params_filters << Regexp.new(filter_words.collect{ |s| s.to_s }.join('|'), true) end end filter_parameter_logging_without_bugsnag(*filter_words, &block) end |