试题和试卷删除时删掉审批数据

dev_cxt
cxt 5 years ago
parent 6b6ea7d06d
commit 22fbb8089b

@ -50,9 +50,12 @@ class ExaminationBanksController < ApplicationController
end
def destroy
ActiveRecord::Base.transaction do
ApplyAction.where(container_type: "ExaminationBank", container_id: @exam.id).destroy_all
@exam.destroy!
render_ok
end
end
def set_public
tip_exception(-1, "该试卷已公开") if @exam.public?

@ -31,9 +31,12 @@ class ItemBanksController < ApplicationController
end
def destroy
ActiveRecord::Base.transaction do
ApplyAction.where(container_type: "ItemBank", container_id: @item.id).destroy_all
@item.destroy!
render_ok
end
end
def set_public
tip_exception(-1, "该试题已公开") if @item.public?

Loading…
Cancel
Save