From 5b109817543f5725713efce71327bb37e92829ad Mon Sep 17 00:00:00 2001 From: nieguanghui Date: Sat, 7 Dec 2013 10:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE=E6=8C=89?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2753f278b..1b069b234 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -288,13 +288,13 @@ class ProjectsController < ApplicationController when '0' @offset ||= @project_pages.reverse_offset unless @offset == 0 - @projects_status = @projects_status.offset(@offset).limit(@limit).all.reverse + @projects_status = @projects_status.includes(:projects).reorder('projects.created_on').offset(@offset).limit(@limit).all.reverse else limit = @project_count % @limit if limit == 0 limit = @limit end - @projects_status = @projects_status.offset(@offset).limit(limit).all.reverse + @projects_status = @projects_status.includes(:projects).reorder('projects.created_on').offset(@offset).limit(limit).all.reverse end @s_type = 0 # @projects = @projects.sort {|x,y| y.created_on <=> x.created_on } @@ -329,13 +329,13 @@ class ProjectsController < ApplicationController else @offset ||= @project_pages.reverse_offset unless @offset == 0 - @projects_status = @projects_status.offset(@offset).limit(@limit).all.reverse + @projects_status = @projects_status.includes(:projects).reorder('projects.created_on').offset(@offset).limit(@limit).all.reverse else limit = @project_count % @limit if limit == 0 limit = @limit end - @projects_status = @projects_status.offset(@offset).limit(limit).all.reverse + @projects_status = @projects_status.includes(:projects).reorder('projects.created_on').offset(@offset).limit(limit).all.reverse end @s_type = 0 # @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }