0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-09 11:52:54 +01:00

use standard naming for custom fields

Dieser Commit ist enthalten in:
Faizaan Gagan 2021-10-30 16:07:16 +05:30
Ursprung dec5f5b5ce
Commit b7575a3295
3 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -21,7 +21,7 @@ module CustomWizardGuardian
end
def creating_wizard(topic)
wizard_id = topic.wizard_created.presence
wizard_id = topic.wizard_id.presence
wizard = CustomWizard::Builder.new(wizard_id, @user).build if wizard_id
wizard.presence
end
@ -38,7 +38,7 @@ module CustomWizardGuardian
submission_data = begin
submissions = CustomWizard::Submission.list(wizard)
submissions.find { |sub| sub.id == topic.wizard_submission }&.fields_and_meta
submissions.find { |sub| sub.id == topic.wizard_submission_id }&.fields_and_meta
end
categories = wizard_actions.map do |action|

Datei anzeigen

@ -517,8 +517,8 @@ class CustomWizard::Action
skip_validations: true,
topic_opts: {
custom_fields: {
wizard_created: @wizard.id,
wizard_submission: @wizard.current_submission.id
wizard_id: @wizard.id,
wizard_submission_id: @wizard.current_submission.id
}
}
}

Datei anzeigen

@ -119,12 +119,12 @@ after_initialize do
Liquid::Template.register_filter(::CustomWizard::LiquidFilter::FirstNonEmpty)
add_to_class(:topic, :wizard_created) do
custom_fields['wizard_created']
add_to_class(:topic, :wizard_id) do
custom_fields['wizard_id']
end
add_to_class(:topic, :wizard_submission) do
custom_fields['wizard_submission']
add_to_class(:topic, :wizard_submission_id) do
custom_fields['wizard_submission_id']
end
add_class_method(:wizard, :user_requires_completion?) do |user|