]> source.dussan.org Git - redmine.git/commitdiff
Replaces find(:all) calls.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Dec 2012 21:28:19 +0000 (21:28 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Dec 2012 21:28:19 +0000 (21:28 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10925 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/files_controller.rb

index f96cd4a9fb414cd4e2c93625244909668ca8a8d2..94965dbfc8d24704b80d5fb6ef2e016c132a061c 100644 (file)
@@ -31,8 +31,8 @@ class FilesController < ApplicationController
                 'size' => "#{Attachment.table_name}.filesize",
                 'downloads' => "#{Attachment.table_name}.downloads"
 
-    @containers = [ Project.find(@project.id, :include => :attachments, :order => sort_clause)]
-    @containers += @project.versions.find(:all, :include => :attachments, :order => sort_clause).sort.reverse
+    @containers = [ Project.includes(:attachments).reorder(sort_clause).find(@project.id)]
+    @containers += @project.versions.includes(:attachments).reorder(sort_clause).all.sort.reverse
     render :layout => !request.xhr?
   end