Commit 458631c5ba8c830021bd7c219affdb0afe6f0efe

Authored by Dmitriy Zaporozhets
1 parent bbfbff3a

remove unnecessary Commit.new

app/contexts/commit_load_context.rb
... ... @@ -12,7 +12,6 @@ class CommitLoadContext < BaseContext
12 12 commit = project.repository.commit(params[:id])
13 13  
14 14 if commit
15   - commit = Commit.new(commit)
16 15 line_notes = project.notes.for_commit_id(commit.id).inline
17 16  
18 17 result[:commit] = commit
... ...
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
... ...