Method: ActiveSupport::BacktraceCleaner#add_filter

Defined in:
activesupport/lib/active_support/backtrace_cleaner.rb

#add_filter(&block) ⇒ Object

Adds a filter from the block provided. Each line in the backtrace will be mapped against this filter.

# Will turn "/my/rails/root/app/models/person.rb" into "app/models/person.rb"
root = "#{Rails.root}/"
backtrace_cleaner.add_filter { |line| line.start_with?(root) ? line.from(root.size) : line }


83
84
85
# File 'activesupport/lib/active_support/backtrace_cleaner.rb', line 83

def add_filter(&block)
  @filters << block
end