diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-01-10 08:13:47 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-01-10 08:13:47 +0000 |
commit | b652f7fc276778f50297431f19320ed7f29468f2 (patch) | |
tree | c767266f9febeac65d2933450d0a7b7df40c9c0f /app/controllers/news_controller.rb | |
parent | 99fe35be422a6763f31c36722378220615d4fba3 (diff) | |
download | redmine-b652f7fc276778f50297431f19320ed7f29468f2.tar.gz redmine-b652f7fc276778f50297431f19320ed7f29468f2.zip |
cleanup syntax of Relation#all at NewsController#index
git-svn-id: http://svn.redmine.org/redmine/trunk@12594 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/news_controller.rb')
-rw-r--r-- | app/controllers/news_controller.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 38ead3531..d6f756cb5 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -42,11 +42,11 @@ class NewsController < ApplicationController @news_count = scope.count @news_pages = Paginator.new @news_count, @limit, params['page'] @offset ||= @news_pages.offset - @newss = scope.all(:include => [:author, :project], - :order => "#{News.table_name}.created_on DESC", - :offset => @offset, - :limit => @limit) - + @newss = scope.includes([:author, :project]). + order("#{News.table_name}.created_on DESC"). + limit(@limit). + offset(@offset). + all respond_to do |format| format.html { @news = News.new # for adding news inline |