From b652f7fc276778f50297431f19320ed7f29468f2 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 10 Jan 2014 08:13:47 +0000 Subject: [PATCH] cleanup syntax of Relation#all at NewsController#index git-svn-id: http://svn.redmine.org/redmine/trunk@12594 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/news_controller.rb | 10 +++++----- 1 file 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 -- 2.39.5