选题拒绝后选题状态报错

dev_course
daiao 6 years ago
parent 45a0f6cf2c
commit 010d2f4049

@ -50,10 +50,10 @@ class GraduationTopic < ApplicationRecord
def student_graduation_topic_status def student_graduation_topic_status
sgt = self.student_graduation_topics sgt = self.student_graduation_topics
status = status =
if sgt.is_accepting.count == 0 if sgt.where(status: [0, 1]).count.zero?
2
elsif sgt.is_refused.count == self.student_graduation_topics.size
0 0
elsif sgt.is_accepting.count.zero?
2
else else
1 1
end end

Loading…
Cancel
Save