Commit d64547e35e9c13821faf57b86ed72f372ee7f751
1 parent
62ee78a8
Exists in
master
and in
1 other branch
If gems are vendored into project, treat vendored gem dir as [GEM_ROOT]
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
app/models/notice.rb
... | ... | @@ -94,6 +94,14 @@ class Notice |
94 | 94 | backtrace.select { |l| l && l['file'] && l['file'].include?("[PROJECT_ROOT]") } |
95 | 95 | end |
96 | 96 | |
97 | + def backtrace | |
98 | + # If gems are vendored into project, treat vendored gem dir as [GEM_ROOT] | |
99 | + (read_attribute(:backtrace) || {}).map do |line| | |
100 | + # Changes "[PROJECT_ROOT]/rubygems/ruby/1.9.1/gems" to "[GEM_ROOT]/gems" | |
101 | + line.merge 'file' => line['file'].gsub(/\[PROJECT_ROOT\]\/.*\/ruby\/[0-9.]+\/gems/, '[GEM_ROOT]/gems') | |
102 | + end | |
103 | + end | |
104 | + | |
97 | 105 | protected |
98 | 106 | |
99 | 107 | def increase_counter_cache | ... | ... |