0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-06-02 13:58:59 +02:00

move destroy logic into library method & transaction

Dieser Commit ist enthalten in:
merefield 2023-07-17 10:16:27 +01:00
Ursprung b71f627d73
Commit 580889a34e
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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