From 010d2f4049ada3e9abeee1f20427c31503a348aa Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 20 Jun 2019 19:52:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E9=A2=98=E6=8B=92=E7=BB=9D=E5=90=8E?= =?UTF-8?q?=E9=80=89=E9=A2=98=E7=8A=B6=E6=80=81=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/graduation_topic.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/graduation_topic.rb b/app/models/graduation_topic.rb index 5a2a630e5..294bfa785 100644 --- a/app/models/graduation_topic.rb +++ b/app/models/graduation_topic.rb @@ -50,10 +50,10 @@ class GraduationTopic < ApplicationRecord def student_graduation_topic_status sgt = self.student_graduation_topics status = - if sgt.is_accepting.count == 0 - 2 - elsif sgt.is_refused.count == self.student_graduation_topics.size + if sgt.where(status: [0, 1]).count.zero? 0 + elsif sgt.is_accepting.count.zero? + 2 else 1 end