From eec36768680ef24fb32d96c39a7f7954c20f9b84 Mon Sep 17 00:00:00 2001 From: Nowa Date: Tue, 5 Apr 2011 19:40:38 +0800 Subject: [PATCH] =?UTF-8?q?Mod:=20=E6=88=91=E7=9A=84=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E6=98=BE=E7=A4=BA=E6=88=91=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E9=A2=98=E8=A2=AB=E5=85=B6=E4=BB=96=E4=BA=BA?= =?UTF-8?q?=E5=85=B3=E6=B3=A8=E7=9A=84=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/home_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 7e0ffbd..8e48bd5 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -11,7 +11,7 @@ def index # .paginate(:page => params[:page], :per_page => @per_page) @per_page = 20 - @logs = Log.any_of({:user_id.in => current_user.following_ids}, {:target_id.in => current_user.followed_ask_ids}, {:target_id.in => current_user.followed_topic_ids}).excludes(:user_id => current_user.id).desc("$natural").paginate(:page => params[:page], :per_page => @per_page) + @logs = Log.any_of({:user_id.in => current_user.following_ids}, {:target_id.in => current_user.followed_ask_ids}).excludes(:user_id => current_user.id).desc("$natural").paginate(:page => params[:page], :per_page => @per_page) redirect_to newbie_path and return if (current_user.following_ids.size == 0 and current_user.followed_ask_ids.size == 0 and current_user.followed_topic_ids.size == 0) or @logs.count < 1 if params[:format] == "js"