diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-27 14:16:34 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-02 11:57:01 +0300 |
commit | d9698628d9042e820917e1144535888da147c228 (patch) | |
tree | 2e503064c3f84c431d690a1cea2cb5a9607238e2 /app/helpers/commits_helper.rb | |
parent | 403b727138e22ce8ba83332ab03fa21fb7f72a1c (diff) |
Add Commit#author and #committer.
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r-- | app/helpers/commits_helper.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 5aae697e2f0..d13d80be293 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -134,12 +134,13 @@ module CommitsHelper # avatar: true will prepend the avatar image # size: size of the avatar image in px def commit_person_link(commit, options = {}) + user = commit.send(options[:source]) + source_name = clean(commit.send "#{options[:source]}_name".to_sym) source_email = clean(commit.send "#{options[:source]}_email".to_sym) - user = User.find_for_commit(source_email, source_name) - person_name = user.nil? ? source_name : user.name - person_email = user.nil? ? source_email : user.email + person_name = user.try(:name) || source_name + person_email = user.try(:email) || source_email text = if options[:avatar] |