题库的删除

dev_jupyter
cxt 5 years ago
parent c64cf2928e
commit f4f62f59dc

@ -41,7 +41,11 @@ class ItemBanksController < ApplicationController
def destroy def destroy
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
ApplyAction.where(container_type: "ItemBank", container_id: @item.id).destroy_all ApplyAction.where(container_type: "ItemBank", container_id: @item.id).destroy_all
@item.destroy! if @item.item_type == "PROGRAM"
@item.container&.destroy!
else
@item.destroy!
end
render_ok render_ok
end end
end end

Loading…
Cancel
Save