move destroy logic into library method & transaction
Dieser Commit ist enthalten in:
Ursprung
b71f627d73
Commit
580889a34e
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
|
@ -26,8 +26,6 @@ class CustomWizard::AdminWizardController < CustomWizard::AdminController
|
||||||
|
|
||||||
def remove
|
def remove
|
||||||
if CustomWizard::Template.remove(@wizard.id)
|
if CustomWizard::Template.remove(@wizard.id)
|
||||||
related_custom_fields = CategoryCustomField.where(name: 'create_topic_wizard', value: @wizard.name)
|
|
||||||
related_custom_fields.destroy_all
|
|
||||||
render json: success_json
|
render json: success_json
|
||||||
else
|
else
|
||||||
render json: failed_json
|
render json: failed_json
|
||||||
|
|
|
@ -64,6 +64,8 @@ class CustomWizard::Template
|
||||||
ensure_wizard_upload_references!(wizard_id)
|
ensure_wizard_upload_references!(wizard_id)
|
||||||
PluginStore.remove(CustomWizard::PLUGIN_NAME, wizard.id)
|
PluginStore.remove(CustomWizard::PLUGIN_NAME, wizard.id)
|
||||||
clear_user_wizard_redirect(wizard_id, after_time: !!wizard.after_time)
|
clear_user_wizard_redirect(wizard_id, after_time: !!wizard.after_time)
|
||||||
|
related_custom_fields = CategoryCustomField.where(name: 'create_topic_wizard', value: wizard.name)
|
||||||
|
related_custom_fields.destroy_all
|
||||||
end
|
end
|
||||||
|
|
||||||
clear_cache_keys
|
clear_cache_keys
|
||||||
|
|
Laden …
In neuem Issue referenzieren