Commit 458631c5ba8c830021bd7c219affdb0afe6f0efe
1 parent
bbfbff3a
Exists in
master
and in
4 other branches
remove unnecessary Commit.new
Showing
3 changed files
with
2 additions
and
5 deletions
Show diff stats
app/contexts/commit_load_context.rb
app/helpers/commits_helper.rb
... | ... | @@ -109,9 +109,7 @@ module CommitsHelper |
109 | 109 | end |
110 | 110 | |
111 | 111 | def commit_to_html commit |
112 | - if commit.model | |
113 | - escape_javascript(render 'commits/commit', commit: commit) | |
114 | - end | |
112 | + escape_javascript(render 'commits/commit', commit: commit) | |
115 | 113 | end |
116 | 114 | |
117 | 115 | def diff_line_content(line) | ... | ... |
app/models/note.rb
... | ... | @@ -130,7 +130,7 @@ class Note < ActiveRecord::Base |
130 | 130 | # override to return commits, which are not active record |
131 | 131 | def noteable |
132 | 132 | if for_commit? |
133 | - Commit.new(project.repository.commit(commit_id)) | |
133 | + project.repository.commit(commit_id) | |
134 | 134 | else |
135 | 135 | super |
136 | 136 | end | ... | ... |