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/documents_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/documents_controller.rb')
-rw-r--r-- | app/controllers/documents_controller.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 6f2432386..118a7d99e 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -17,8 +17,9 @@ class DocumentsController < ApplicationController default_search_scope :documents + model_object Document before_filter :find_project, :only => [:index, :new] - before_filter :find_document, :except => [:index, :new] + before_filter :find_model_object, :except => [:index, :new] before_filter :find_project_from_association, :except => [:index, :new] before_filter :authorize @@ -82,10 +83,4 @@ private rescue ActiveRecord::RecordNotFound render_404 end - - def find_document - @document = @object = Document.find(params[:id]) - rescue ActiveRecord::RecordNotFound - render_404 - end end |