Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use Rails' backtrace silencers to clean the trace.

  • Loading branch information...
commit e8a6b49ea9fb8e680663e051789fdd33eb336eaa 1 parent 9ce6f2e
@archfear archfear authored committed
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/query_trace.rb
View
7 lib/query_trace.rb
@@ -37,10 +37,9 @@ def format_trace(trace)
end
end
- VENDOR_RAILS_REGEXP = %r(([\\/:])vendor\1rails\1)
def clean_trace(trace)
- return trace unless defined?(RAILS_ROOT)
-
- trace.select{|t| /#{Regexp.escape(File.expand_path(RAILS_ROOT))}/ =~ t}.reject{|t| VENDOR_RAILS_REGEXP =~ t}.collect{|t| t.gsub(RAILS_ROOT + '/', '')}
+ Rails.respond_to?(:backtrace_cleaner) ?
+ Rails.backtrace_cleaner.clean(trace) :
+ trace
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.