lib/honeybadger/config/ruby.rb in honeybadger-4.2.0 vs lib/honeybadger/config/ruby.rb in honeybadger-4.2.1

- old
+ new

@@ -80,16 +80,18 @@ def backend get(:backend) || config.backend end def before_notify(action = nil, &block) - (hash[:before_notify] ||= []).tap do |before_notify_hooks| - if action && validate_before_action(action) - before_notify_hooks << action - elsif block_given? && validate_before_action(block) - before_notify_hooks << block - end + hooks = Array(get(:before_notify)).dup + + if action && validate_before_action(action) + hooks << action + elsif block_given? && validate_before_action(block) + hooks << block end + + hash[:before_notify] = hooks end def backtrace_filter if block_given? logger.warn('DEPRECATED: backtrace_filter is deprecated. Please use before_notify instead. See https://docs.honeybadger.io/ruby/support/v4-upgrade#backtrace_filter')