Skip to content

Commit 869c7bf

Browse files
committed
Improve BacktraceCleaner code example [ci-skip]
With newer rubies, removing a prefix is much simpler.
1 parent ff0ef93 commit 869c7bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activesupport/lib/active_support/backtrace_cleaner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module ActiveSupport
1818
#
1919
# bc = ActiveSupport::BacktraceCleaner.new
2020
# root = "#{Rails.root}/"
21-
# bc.add_filter { |line| line.start_with?(root) ? line.from(root.size) : line } # strip the Rails.root prefix
21+
# bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix
2222
# bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems
2323
# bc.clean(exception.backtrace) # perform the cleanup
2424
#

0 commit comments

Comments
 (0)