diff --git a/app/controllers/item_banks_controller.rb b/app/controllers/item_banks_controller.rb index 86b1523c3..f108c1fad 100644 --- a/app/controllers/item_banks_controller.rb +++ b/app/controllers/item_banks_controller.rb @@ -43,8 +43,9 @@ class ItemBanksController < ApplicationController ApplyAction.where(container_type: "ItemBank", container_id: @item.id).destroy_all if @item.item_type == "PROGRAM" @item.container&.destroy! + else + @item.destroy! end - @item.destroy! render_ok end end diff --git a/app/models/hack.rb b/app/models/hack.rb index 0c5970af4..9c8ca44fb 100644 --- a/app/models/hack.rb +++ b/app/models/hack.rb @@ -23,7 +23,6 @@ class Hack < ApplicationRecord belongs_to :sub_discipline has_one :item_bank, as: :container, dependent: :destroy - has_one :examination_bank, as: :container, dependent: :destroy scope :published, -> { where(status: 1) } scope :unpublish, -> { where(status: 0) }