From 869c7bf094c0478b101d4c0e55766501ca31a325 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 19 Jun 2024 09:16:30 +0200 Subject: [PATCH] Improve BacktraceCleaner code example [ci-skip] With newer rubies, removing a prefix is much simpler. --- activesupport/lib/active_support/backtrace_cleaner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/backtrace_cleaner.rb b/activesupport/lib/active_support/backtrace_cleaner.rb index 1286e9d12b..80b53307bf 100644 --- a/activesupport/lib/active_support/backtrace_cleaner.rb +++ b/activesupport/lib/active_support/backtrace_cleaner.rb @@ -18,7 +18,7 @@ module ActiveSupport # # bc = ActiveSupport::BacktraceCleaner.new # root = "#{Rails.root}/" - # bc.add_filter { |line| line.start_with?(root) ? line.from(root.size) : line } # strip the Rails.root prefix + # bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix # bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems # bc.clean(exception.backtrace) # perform the cleanup #