diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-03-17 15:41:58 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-03-17 15:41:58 +0000 |
commit | 194dab8e96f632c457e49cce60611c30af68ef5b (patch) | |
tree | 9523207317165bd372b81d0120c6fd43b59f3ea6 /app/controllers/issue_categories_controller.rb | |
parent | 0f999ef0e09ea5672c79294c7119f3766285f8c1 (diff) | |
download | redmine-194dab8e96f632c457e49cce60611c30af68ef5b.tar.gz redmine-194dab8e96f632c457e49cce60611c30af68ef5b.zip |
Refactor: Change the different find_object filters to share a common method.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3597 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issue_categories_controller.rb')
-rw-r--r-- | app/controllers/issue_categories_controller.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/controllers/issue_categories_controller.rb b/app/controllers/issue_categories_controller.rb index 2904c2399..a43a767bb 100644 --- a/app/controllers/issue_categories_controller.rb +++ b/app/controllers/issue_categories_controller.rb @@ -17,7 +17,8 @@ class IssueCategoriesController < ApplicationController menu_item :settings - before_filter :find_category, :except => :new + model_object IssueCategory + before_filter :find_model_object, :except => :new before_filter :find_project_from_association, :except => :new before_filter :find_project, :only => :new before_filter :authorize @@ -73,10 +74,11 @@ class IssueCategoriesController < ApplicationController end private - def find_category - @category = @object = IssueCategory.find(params[:id]) - rescue ActiveRecord::RecordNotFound - render_404 + # Wrap ApplicationController's find_model_object method to set + # @category instead of just @issue_category + def find_model_object + super + @category = @object end def find_project |