cleanup syntax of Relation#all at NewsController#index

git-svn-id: http://svn.redmine.org/redmine/trunk@12594 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-10 08:13:47 +00:00
parent 99fe35be42
commit b652f7fc27
1 changed files with 5 additions and 5 deletions

View File

@ -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