From 194dab8e96f632c457e49cce60611c30af68ef5b Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 17 Mar 2010 15:41:58 +0000 Subject: 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 --- app/controllers/documents_controller.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'app/controllers/documents_controller.rb') 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 -- cgit v1.2.3