Commit f85a8a16eeee19b27b130eda24b3595a3a50898a
1 parent
ced5a311
Exists in
master
and in
1 other branch
Updated GitHub linkage on a notice to be directly on the backtrace line numbers,…
… not in the summary area. Conflicts: app/models/notice.rb app/views/notices/_summary.html.haml
Showing
4 changed files
with
9 additions
and
9 deletions
Show diff stats
app/helpers/errs_helper.rb
| ... | ... | @@ -8,11 +8,11 @@ module ErrsHelper |
| 8 | 8 | Errbit::Config.confirm_resolve_err === false ? nil : 'Seriously?' |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | - def link_to_github app, notice | |
| 11 | + def link_to_github app, notice, text=nil | |
| 12 | 12 | file_name = notice.top_in_app_backtrace_line['file'].split('/').last |
| 13 | 13 | file_path = notice.top_in_app_backtrace_line['file'].gsub('[PROJECT_ROOT]', '') |
| 14 | 14 | line_number = notice.top_in_app_backtrace_line['number'] |
| 15 | - link_to(file_name, "#{app.github_url_to_file(file_path)}#L#{line_number}", :target => '_blank') | |
| 15 | + link_to(text || file_name, "#{app.github_url_to_file(file_path)}#L#{line_number}", :target => '_blank') | |
| 16 | 16 | end |
| 17 | 17 | |
| 18 | 18 | end |
| 19 | 19 | \ No newline at end of file | ... | ... |
app/models/notice.rb
| ... | ... | @@ -56,6 +56,10 @@ class Notice |
| 56 | 56 | agent_string.blank? ? nil : UserAgent.parse(agent_string) |
| 57 | 57 | end |
| 58 | 58 | |
| 59 | + def self.in_app_backtrace_line? line | |
| 60 | + line['file'] =~ %r{^\[PROJECT_ROOT\]/(?!(vendor))} | |
| 61 | + end | |
| 62 | + | |
| 59 | 63 | def request |
| 60 | 64 | read_attribute(:request) || {} |
| 61 | 65 | end |
| ... | ... | @@ -81,7 +85,7 @@ class Notice |
| 81 | 85 | end |
| 82 | 86 | |
| 83 | 87 | def top_in_app_backtrace_line |
| 84 | - @top_in_app_backtrace_line ||= self.backtrace.find {|line| line['file'] =~ %r{^\[PROJECT_ROOT\]/(?!(vendor))} } | |
| 88 | + @top_in_app_backtrace_line ||= self.backtrace.find {|line| Notice.in_app_backtrace_line?(line) } | |
| 85 | 89 | end |
| 86 | 90 | |
| 87 | 91 | protected |
| ... | ... | @@ -122,4 +126,3 @@ class Notice |
| 122 | 126 | end |
| 123 | 127 | end |
| 124 | 128 | end |
| 125 | - | ... | ... |
app/views/notices/_backtrace.html.haml