]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Jul 2012 17:37:03 +0000 (17:37 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Jul 2012 17:37:03 +0000 (17:37 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9905 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb

index 492e31795c8f35aa3860de776b3d76621ec7cc81..ffb932f34f1a97809ec8e835d6d4e65d0594fcc0 100644 (file)
@@ -156,12 +156,8 @@ class ProjectsController < ApplicationController
 
     cond = @project.project_condition(Setting.display_subprojects_issues?)
 
-    @open_issues_by_tracker = Issue.visible.count(:group => :tracker,
-                                            :include => [:project, :status, :tracker],
-                                            :conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false])
-    @total_issues_by_tracker = Issue.visible.count(:group => :tracker,
-                                            :include => [:project, :status, :tracker],
-                                            :conditions => cond)
+    @open_issues_by_tracker = Issue.visible.open.where(cond).count(:group => :tracker)
+    @total_issues_by_tracker = Issue.visible.where(cond).count(:group => :tracker)
 
     if User.current.allowed_to?(:view_time_entries, @project)
       @total_hours = TimeEntry.visible.sum(:hours, :include => :project, :conditions => cond).to_f