From 0e32e63b7b836c3792b1f340af584327d39c9314 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 27 Jun 2019 09:34:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E9=80=89=E9=A2=98=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_topics_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/graduation_topics_controller.rb b/app/controllers/graduation_topics_controller.rb index 7a61613da..521aaffc6 100644 --- a/app/controllers/graduation_topics_controller.rb +++ b/app/controllers/graduation_topics_controller.rb @@ -24,8 +24,7 @@ class GraduationTopicsController < ApplicationController end # 当前用户是否已经选过题 - user_graduation_topics = @course.student_graduation_topics.where(user_id: current_user.id, status: [0, 1]) #6.12 -hs - @user_selected = user_graduation_topics.size > 0 + @user_selected = @course.student_graduation_topics.where(user_id: current_user.id, status: [0, 1]).count > 0 #6.12 -hs ## 分页参数 page = params[:page] || 1 limit = params[:limit] || 15