diff --git a/app/helpers/errs_helper.rb b/app/helpers/errs_helper.rb index cd99153..a76d5db 100644 --- a/app/helpers/errs_helper.rb +++ b/app/helpers/errs_helper.rb @@ -8,10 +8,10 @@ module ErrsHelper Errbit::Config.confirm_resolve_err === false ? nil : 'Seriously?' end - def link_to_github app, notice, text=nil - file_name = notice.top_in_app_backtrace_line['file'].split('/').last - file_path = notice.top_in_app_backtrace_line['file'].gsub('[PROJECT_ROOT]', '') - line_number = notice.top_in_app_backtrace_line['number'] + def link_to_github app, line, text=nil + file_name = line['file'].split('/').last + file_path = line['file'].gsub('[PROJECT_ROOT]', '') + line_number = line['number'] link_to(text || file_name, "#{app.github_url_to_file(file_path)}#L#{line_number}", :target => '_blank') end diff --git a/app/views/notices/_backtrace.html.haml b/app/views/notices/_backtrace.html.haml index 54c0622..1764a93 100644 --- a/app/views/notices/_backtrace.html.haml +++ b/app/views/notices/_backtrace.html.haml @@ -4,7 +4,7 @@ %th %ul.line-numbers - lines.each do |line| - %li= (@app.github_url? && Notice.in_app_backtrace_line?(line)) ? link_to_github(@app, @notice, line['number']) : line['number'] + %li= (@app.github_url? && Notice.in_app_backtrace_line?(line)) ? link_to_github(@app, line, line['number']) : line['number'] %td %ul.lines -- libgit2 0.21.2