Commit 025c89ad11cf5b354bdee6976e2c62d3c6a0f529
1 parent
ac9b0a43
Exists in
master
and in
1 other branch
fix Problems#show action after mongoid5 refactor
Showing
4 changed files
with
16 additions
and
3 deletions
Show diff stats
app/controllers/problems_controller.rb
... | ... | @@ -50,9 +50,9 @@ class ProblemsController < ApplicationController |
50 | 50 | def index; end |
51 | 51 | |
52 | 52 | def show |
53 | - @notices = problem.object.notices.reverse_ordered | |
53 | + @notices = problem.object.notices.reverse_ordered | |
54 | 54 | .page(params[:notice]).per(1) |
55 | - @notice = @notices.first | |
55 | + @notice = NoticeDecorator.new @notices.first | |
56 | 56 | @comment = Comment.new |
57 | 57 | end |
58 | 58 | ... | ... |
app/decorators/backtrace_line_decorator.rb
... | ... | @@ -9,6 +9,10 @@ class BacktraceLineDecorator < Draper::Decorator |
9 | 9 | object[:number] |
10 | 10 | end |
11 | 11 | |
12 | + def column | |
13 | + object[:column] | |
14 | + end | |
15 | + | |
12 | 16 | def file |
13 | 17 | object[:file] |
14 | 18 | end |
... | ... | @@ -35,6 +39,14 @@ class BacktraceLineDecorator < Draper::Decorator |
35 | 39 | link_to_in_app_source_file(app, text) || text |
36 | 40 | end |
37 | 41 | |
42 | + def path | |
43 | + File.dirname(object[:file]).gsub(/^\.$/, '') + "/" | |
44 | + end | |
45 | + | |
46 | + def decorated_path | |
47 | + file_relative.sub(Backtrace::GEMS_PATH, "<strong>\\1</strong>") | |
48 | + end | |
49 | + | |
38 | 50 | private |
39 | 51 | def link_to_in_app_source_file(app, text) |
40 | 52 | return unless in_app? | ... | ... |
app/models/backtrace.rb
app/views/problems/show.html.haml