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
|
||||
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
|
||||
else
|
||||
render json: failed_json
|
||||
|
|
|
@ -64,6 +64,8 @@ class CustomWizard::Template
|
|||
ensure_wizard_upload_references!(wizard_id)
|
||||
PluginStore.remove(CustomWizard::PLUGIN_NAME, wizard.id)
|
||||
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
|
||||
|
||||
clear_cache_keys
|
||||
|
|
Laden …
In neuem Issue referenzieren