Prefer user email match when looking for commit author

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2013-11-20 11:19:51 +02:00
parent 893153113d
commit 8ddb064bbd
No known key found for this signature in database
GPG Key ID: 2CEAFD2671262EC2
1 changed files with 3 additions and 1 deletions

View File

@ -125,7 +125,9 @@ module CommitsHelper
source_name
end
user = User.where('name like ? or email like ?', source_name, source_email).first
# Prefer email match over name match
user = User.where(email: source_email).first
user ||= User.where(name: source_name).first
options = {
class: "commit-#{options[:source]}-link has_tooltip",