diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-31 23:58:17 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-31 23:58:17 +0300 |
commit | 458631c5ba8c830021bd7c219affdb0afe6f0efe (patch) | |
tree | 29fc855da8d303fa4f4788addcc00af8fc2b950d | |
parent | bbfbff3add4c78ce1256ac3bbe787cc6eb9fe1b9 (diff) | |
download | gitlab-ce-458631c5ba8c830021bd7c219affdb0afe6f0efe.tar.gz |
remove unnecessary Commit.new
-rw-r--r-- | app/contexts/commit_load_context.rb | 1 | ||||
-rw-r--r-- | app/helpers/commits_helper.rb | 4 | ||||
-rw-r--r-- | app/models/note.rb | 2 |
3 files changed, 2 insertions, 5 deletions
diff --git a/app/contexts/commit_load_context.rb b/app/contexts/commit_load_context.rb index a06523776cc..2cf5420d62d 100644 --- a/app/contexts/commit_load_context.rb +++ b/app/contexts/commit_load_context.rb @@ -12,7 +12,6 @@ class CommitLoadContext < BaseContext commit = project.repository.commit(params[:id]) if commit - commit = Commit.new(commit) line_notes = project.notes.for_commit_id(commit.id).inline result[:commit] = commit diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index da209e06421..66603c97142 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -109,9 +109,7 @@ module CommitsHelper end def commit_to_html commit - if commit.model - escape_javascript(render 'commits/commit', commit: commit) - end + escape_javascript(render 'commits/commit', commit: commit) end def diff_line_content(line) diff --git a/app/models/note.rb b/app/models/note.rb index 17ceb541b80..f26420ca2a0 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -130,7 +130,7 @@ class Note < ActiveRecord::Base # override to return commits, which are not active record def noteable if for_commit? - Commit.new(project.repository.commit(commit_id)) + project.repository.commit(commit_id) else super end |