diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-03-16 15:17:47 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-03-16 15:17:47 +0000 |
commit | e6c8760ad77a6d4256f11e409734b0501450e588 (patch) | |
tree | 7349850d4a56713a097595dc23a0443d45defc14 /app/controllers/news_controller.rb | |
parent | 6b88de1234524faa3beae8b54b2887dbb4a2867c (diff) | |
download | redmine-e6c8760ad77a6d4256f11e409734b0501450e588.tar.gz redmine-e6c8760ad77a6d4256f11e409734b0501450e588.zip |
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
Diffstat (limited to 'app/controllers/news_controller.rb')
-rw-r--r-- | app/controllers/news_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |