From 77f1d0c6f041bac696096311faf1b1377c92d43d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 28 Nov 2019 16:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E4=B8=8A=E5=AE=9E=E9=AA=8C=E5=AE=A4?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B7=BB=E5=8A=A0=E7=9A=84=E5=AE=9E=E8=B7=B5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=97=B6=E5=88=A0=E9=99=A4=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/laboratory_subjects_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/admins/laboratory_subjects_controller.rb b/app/controllers/admins/laboratory_subjects_controller.rb index 866a20a76..d552b006e 100644 --- a/app/controllers/admins/laboratory_subjects_controller.rb +++ b/app/controllers/admins/laboratory_subjects_controller.rb @@ -17,7 +17,9 @@ class Admins::LaboratorySubjectsController < Admins::BaseController def destroy return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership? - current_laboratory_subject.destroy! + current_subject = current_laboratory_subject.subject + current_subject.shixuns.destroy_all + current_subject.destroy! render_delete_success end