]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 10 Jun 2012 18:56:42 +0000 (18:56 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 10 Jun 2012 18:56:42 +0000 (18:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9808 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/subversion.rb

index 98c5bc1086f945db4349ccd61d7a090c743c0f55..7c12f3f3e599951233ceb081fdcd25f71d454140 100644 (file)
@@ -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