实践课程删除实训

chromesetting
cxt 6 years ago
parent cbcf141156
commit 07c117216d

@ -17,6 +17,7 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
def destroy def destroy
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership? return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
ActiveRecord::Base.transaction do
current_subject = current_laboratory_subject.subject current_subject = current_laboratory_subject.subject
current_subject.shixuns.each do |shixun| current_subject.shixuns.each do |shixun|
shixun.destroy! shixun.destroy!
@ -25,6 +26,7 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
render_delete_success render_delete_success
end end
end
def homepage def homepage

Loading…
Cancel
Save