summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2014-08-31 17:36:06 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2014-08-31 17:36:06 +0000
commitc190496f240f0f438d7babcbb068adbe26986a56 (patch)
tree0a43201c25d6c5e005384f459523c4eb3ca577dd /app
parentad9a35c6b917d6a96d1ca4312e2a10923c261e5b (diff)
downloadredmine-c190496f240f0f438d7babcbb068adbe26986a56.tar.gz
redmine-c190496f240f0f438d7babcbb068adbe26986a56.zip
Fix syntax for ruby 1.8.7 (#13487).
git-svn-id: http://svn.redmine.org/redmine/trunk@13362 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 9f50c6358..fe08e95ce 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -414,17 +414,12 @@ class Repository < ActiveRecord::Base
# Notes:
# - this hash honnors the users mapping defined for the repository
def stats_by_author
- commits = Changeset.where("repository_id = ?", id)
- .select("committer, user_id, count(*) as count")
- .group("committer, user_id")
+ commits = Changeset.where("repository_id = ?", id).select("committer, user_id, count(*) as count").group("committer, user_id")
#TODO: restore ordering ; this line probably never worked
#commits.to_a.sort! {|x, y| x.last <=> y.last}
- changes = Change.joins(:changeset)
- .where("#{Changeset.table_name}.repository_id = ?", id)
- .select("committer, user_id, count(*) as count")
- .group("committer, user_id")
+ changes = Change.joins(:changeset).where("#{Changeset.table_name}.repository_id = ?", id).select("committer, user_id, count(*) as count").group("committer, user_id")
user_ids = changesets.map(&:user_id).compact.uniq
authors_names = User.where(:id => user_ids).inject({}) do |memo, user|