]> source.dussan.org Git - redmine.git/commitdiff
Refactored IssueStatus finder to a before_filter
authorEric Davis <edavis@littlestreamsoftware.com>
Thu, 11 Feb 2010 16:42:52 +0000 (16:42 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Thu, 11 Feb 2010 16:42:52 +0000 (16:42 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3410 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/reports_controller.rb

index 19eee5fbaaac7cf5c26dc2e525af0cf860508f3b..4b7942a7cc0fa54b319fe702839ba3be43c82337 100644 (file)
 
 class ReportsController < ApplicationController
   menu_item :issues
-  before_filter :find_project, :authorize
+  before_filter :find_project, :authorize, :find_issue_statuses
 
   def issue_report
-    @statuses = IssueStatus.find(:all, :order => 'position')
-    
     @trackers = @project.trackers
     @versions = @project.shared_versions.sort
     @priorities = IssuePriority.all
@@ -42,8 +40,6 @@ class ReportsController < ApplicationController
   end  
 
   def issue_report_details
-    @statuses = IssueStatus.find(:all, :order => 'position')
-
     case params[:detail]
     when "tracker"
       @field = "tracker_id"
@@ -91,4 +87,9 @@ class ReportsController < ApplicationController
     end
   end
 
+  private
+
+  def find_issue_statuses
+    @statuses = IssueStatus.find(:all, :order => 'position')
+  end
 end