Refactored IssueStatus finder to a before_filter

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3410 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis 2010-02-11 16:42:52 +00:00
parent 2c8a24092b
commit 937d0c70f7
1 changed files with 6 additions and 5 deletions

View File

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