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:
parent
99fe35be42
commit
b652f7fc27
|
@ -42,11 +42,11 @@ class NewsController < ApplicationController
|
||||||
@news_count = scope.count
|
@news_count = scope.count
|
||||||
@news_pages = Paginator.new @news_count, @limit, params['page']
|
@news_pages = Paginator.new @news_count, @limit, params['page']
|
||||||
@offset ||= @news_pages.offset
|
@offset ||= @news_pages.offset
|
||||||
@newss = scope.all(:include => [:author, :project],
|
@newss = scope.includes([:author, :project]).
|
||||||
:order => "#{News.table_name}.created_on DESC",
|
order("#{News.table_name}.created_on DESC").
|
||||||
:offset => @offset,
|
limit(@limit).
|
||||||
:limit => @limit)
|
offset(@offset).
|
||||||
|
all
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
@news = News.new # for adding news inline
|
@news = News.new # for adding news inline
|
||||||
|
|
Loading…
Reference in New Issue