diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 09b76781f..48b66df2d 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -18,7 +18,7 @@ class DocumentsController < ApplicationController default_search_scope :documents model_object Document - before_filter :find_project, :only => [:index, :new] + before_filter :find_project_by_project_id, :only => [:index, :new] before_filter :find_model_object, :except => [:index, :new] before_filter :find_project_from_association, :except => [:index, :new] before_filter :authorize @@ -76,11 +76,4 @@ class DocumentsController < ApplicationController Mailer.deliver_attachments_added(attachments[:files]) if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added') redirect_to :action => 'show', :id => @document end - -private - def find_project - @project = Project.find(params[:project_id]) - rescue ActiveRecord::RecordNotFound - render_404 - end end