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