From 8c945fb7914b50ead0c608d8530dbee496b1e878 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Barth Date: Tue, 26 Aug 2014 17:32:01 +0000 Subject: Honnor committers/users mapping in repository statistics (#13487). git-svn-id: http://svn.redmine.org/redmine/trunk@13353 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/models/repository.rb') diff --git a/app/models/repository.rb b/app/models/repository.rb index 3e5174d2a..55cdb6d88 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -421,9 +421,10 @@ class Repository < ActiveRecord::Base h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o} commits_by_author.inject({}) do |hash, (name, commits_count)| - hash[name] = {} - hash[name][:commits_count] = commits_count - hash[name][:changes_count] = h[name] || 0 + mapped_name = (find_committer_user(name) || name).to_s + hash[mapped_name] ||= { :commits_count => 0, :changes_count => 0 } + hash[mapped_name][:commits_count] += commits_count + hash[mapped_name][:changes_count] += h[name] || 0 hash end end -- cgit v1.2.3