From a1339c595bb800a8eab36edf2784f57b72a50e1f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 21 Sep 2019 19:49:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/create_subject_course_student_job.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/jobs/create_subject_course_student_job.rb b/app/jobs/create_subject_course_student_job.rb index 38ff83024..4675b59aa 100644 --- a/app/jobs/create_subject_course_student_job.rb +++ b/app/jobs/create_subject_course_student_job.rb @@ -12,9 +12,8 @@ class CreateSubjectCourseStudentJob < ApplicationJob course.subject.subject_appointments.each do |app| next if course.students.where(user_id: app.user_id).any? worker.add same_attrs.merge(user_id: app.user_id) + app.destroy end end - - course.subject.subject_appointments.destroy_all end end