Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use Rails' backtrace silencers to clean the trace.

  • Loading branch information...
commit e8a6b49ea9fb8e680663e051789fdd33eb336eaa 1 parent 9ce6f2e
Dan Dofter archfear authored committed

Showing 1 changed file with 3 additions and 4 deletions. Show diff stats Hide diff stats

  1. +3 4 lib/query_trace.rb
7 lib/query_trace.rb
@@ -37,10 +37,9 @@ def format_trace(trace)
37 37 end
38 38 end
39 39
40   - VENDOR_RAILS_REGEXP = %r(([\\/:])vendor\1rails\1)
41 40 def clean_trace(trace)
42   - return trace unless defined?(RAILS_ROOT)
43   -
44   - trace.select{|t| /#{Regexp.escape(File.expand_path(RAILS_ROOT))}/ =~ t}.reject{|t| VENDOR_RAILS_REGEXP =~ t}.collect{|t| t.gsub(RAILS_ROOT + '/', '')}
  41 + Rails.respond_to?(:backtrace_cleaner) ?
  42 + Rails.backtrace_cleaner.clean(trace) :
  43 + trace
45 44 end
46 45 end

0 comments on commit e8a6b49

Please sign in to comment.
Something went wrong with that request. Please try again.