use standard naming for custom fields
Dieser Commit ist enthalten in:
Ursprung
dec5f5b5ce
Commit
b7575a3295
3 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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|
|
||||
|
|
Laden …
In neuem Issue referenzieren