From 888d2841367a32b924670f94bca024ebf4b28bee Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 10 Jun 2012 18:56:42 +0000 Subject: [PATCH] Code cleanup. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9808 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository/subversion.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb index 98c5bc108..7c12f3f3e 100644 --- a/app/models/repository/subversion.rb +++ b/app/models/repository/subversion.rb @@ -40,7 +40,12 @@ class Repository::Subversion < Repository def latest_changesets(path, rev, limit=10) revisions = scm.revisions(path, rev, nil, :limit => limit) - revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier), :order => "committed_on DESC", :include => :user) : [] + if revisions + identifiers = revisions.collect(&:identifier).compact + changesets.where(:revision => identifiers).reorder("committed_on DESC").includes(:repository, :user).all + else + [] + end end # Returns a path relative to the url of the repository