aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/backtrace_cleaner.rb
diff options
context:
space:
mode:
authorMark J. Titorenko <mark@titorenko.net>2013-06-20 13:51:01 +0100
committerMark J. Titorenko <mark@titorenko.net>2013-06-20 19:54:32 +0100
commita3678e45ecf8e17527722889d5347325083ad560 (patch)
tree4a07cb3e420d2d861ccc1432b87db667a945fd91 /activesupport/lib/active_support/backtrace_cleaner.rb
parent7c69a829a311a31109939cff19b700b36b97d5c4 (diff)
downloadrails-a3678e45ecf8e17527722889d5347325083ad560.tar.gz
rails-a3678e45ecf8e17527722889d5347325083ad560.tar.bz2
rails-a3678e45ecf8e17527722889d5347325083ad560.zip
Fix BacktraceCleaner#noise for multiple silencers.
The previous implementation of BacktraceSilencer#noise did not work correctly if more than one silencer was configured -- specifically, it would only return noise which was matched by all silencers. The new implementation is such that anything that has been matched by silencers is removed from the backtrace using Array#- (array difference), ie. we now return all elements within a backtrace that have been matched by any silencer (and are thus removed by #silence). Fixes #11030.
Diffstat (limited to 'activesupport/lib/active_support/backtrace_cleaner.rb')
-rw-r--r--activesupport/lib/active_support/backtrace_cleaner.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/backtrace_cleaner.rb b/activesupport/lib/active_support/backtrace_cleaner.rb
index 6f9dc679c2..c88ae3e661 100644
--- a/activesupport/lib/active_support/backtrace_cleaner.rb
+++ b/activesupport/lib/active_support/backtrace_cleaner.rb
@@ -97,11 +97,7 @@ module ActiveSupport
end
def noise(backtrace)
- @silencers.each do |s|
- backtrace = backtrace.select { |line| s.call(line) }
- end
-
- backtrace
+ backtrace - silence(backtrace)
end
end
end