Refactor: Split the find_object methods to prep for a larger refactoring.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3591 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-03-16 15:17:47 +00:00
parent 6b88de1234
commit e6c8760ad7
8 changed files with 24 additions and 16 deletions
+2 -2
View File
@@ -19,6 +19,7 @@ class DocumentsController < ApplicationController
default_search_scope :documents
before_filter :find_project, :only => [:index, :new]
before_filter :find_document, :except => [:index, :new]
before_filter :find_project_from_association, :except => [:index, :new]
before_filter :authorize
helper :attachments
@@ -83,8 +84,7 @@ private
end
def find_document
@document = Document.find(params[:id])
@project = @document.project
@document = @object = Document.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end