[#19] fix search of the committer

This commit is contained in:
Alexander Machehin 2013-03-28 22:01:59 +06:00
parent 70e37925c6
commit 0ed81826b0
1 changed files with 2 additions and 6 deletions

View File

@ -3,7 +3,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
include CommitHelper include CommitHelper
attr_accessor :commit attr_accessor :commit
attr_reader :header, :image, :date, :caption, :content, :expandable, :is_reference_to_issue attr_reader :header, :image, :date, :caption, :content, :expandable, :is_reference_to_issue, :committer
def initialize(commit, opts = {}) def initialize(commit, opts = {})
comment = opts[:comment] comment = opts[:comment]
@ -16,7 +16,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
if @project if @project
commit = commit || @project.repo.commit(comment.data[:commit_hash]) commit = commit || @project.repo.commit(comment.data[:commit_hash])
@committer = commit.committer @committer = User.where(:email => commit.committer.email).first || commit.committer
@commit_hash = commit.id @commit_hash = commit.id
@committed_date, @authored_date = commit.committed_date, commit.authored_date @committed_date, @authored_date = commit.committed_date, commit.authored_date
@commit_message = commit.message @commit_message = commit.message
@ -79,10 +79,6 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
protected protected
def committer
@committer ||= User.where(:email => @commiter.email).first || @commiter
end
def committer_link def committer_link
@committer_link ||= if committer.is_a? User @committer_link ||= if committer.is_a? User
link_to committer.uname, user_path(committer) link_to committer.uname, user_path(committer)