选题拒绝后选题状态报错

dev_course
daiao 6 years ago
parent 45a0f6cf2c
commit 010d2f4049

@ -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

Loading…
Cancel
Save