Skip to content

Commit 84b7adc

Browse files
author
root
committed
Fix #383 and Fix #385
1 parent 7d48826 commit 84b7adc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: app/reports/repository_commits_stats.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ def total_commits_by_day
130130

131131

132132
def total_changes_by_day
133-
@total_changes_by_day ||= Change.joins(:changeset).where("#{Changeset.table_name}.repository_id = ?", repository.id).group(:commit_date).order(:commit_date).count
133+
changes = {}
134+
Changeset.where("repository_id = ?", repository.id).order(:commit_date).each do |changeset|
135+
changes[changeset.commit_date] = 0 if !changes.has_key?(changeset.commit_date)
136+
changes[changeset.commit_date] += changeset.filechanges.size
137+
end
138+
@total_changes_by_day ||= changes
134139
end
135140

136141

0 commit comments

Comments
 (0)