From e6c8760ad77a6d4256f11e409734b0501450e588 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Tue, 16 Mar 2010 15:17:47 +0000 Subject: 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 --- app/controllers/news_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/news_controller.rb') diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 53e0addf2..5ce216fb7 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -18,6 +18,7 @@ class NewsController < ApplicationController default_search_scope :news before_filter :find_news, :except => [:new, :index, :preview] + before_filter :find_project_from_association, :except => [:new, :index, :preview] before_filter :find_project, :only => [:new, :preview] before_filter :authorize, :except => [:index, :preview] before_filter :find_optional_project, :only => :index @@ -89,8 +90,7 @@ class NewsController < ApplicationController private def find_news - @news = News.find(params[:id]) - @project = @news.project + @news = @object = News.find(params[:id]) rescue ActiveRecord::RecordNotFound render_404 end -- cgit v1.2.3