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