Merge branch 'dev_cxt' into dev_item_bank

dev_jupyter
cxt 5 years ago
commit 7f6d2de67e

@ -12,7 +12,7 @@ class Admins::ExaminationAuthenticationsController < Admins::BaseController
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
exam = ExaminationBank.find current_apply.container_id exam = ExaminationBank.find current_apply.container_id
current_apply.update!(status: 1) current_apply.update!(status: 1)
exam.update!(public: 0) exam.update!(public: 1)
end end
render_success_js render_success_js
end end

@ -16,7 +16,7 @@ class Admins::ItemAuthenticationsController < Admins::BaseController
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
item = ItemBank.find current_apply.container_id item = ItemBank.find current_apply.container_id
current_apply.update!(status: 1) current_apply.update!(status: 1)
item.update!(public: 0) item.update!(public: 1)
end end
render_success_js render_success_js
end end

@ -50,8 +50,11 @@ class ExaminationBanksController < ApplicationController
end end
def destroy def destroy
@exam.destroy! ActiveRecord::Base.transaction do
render_ok ApplyAction.where(container_type: "ExaminationBank", container_id: @exam.id).destroy_all
@exam.destroy!
render_ok
end
end end
def set_public def set_public

@ -39,8 +39,11 @@ class ItemBanksController < ApplicationController
end end
def destroy def destroy
@item.destroy! ActiveRecord::Base.transaction do
render_ok ApplyAction.where(container_type: "ItemBank", container_id: @item.id).destroy_all
@item.destroy!
render_ok
end
end end
def set_public def set_public

Loading…
Cancel
Save