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
|
end
|
||||||
|
|
||||||
def creating_wizard(topic)
|
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 = CustomWizard::Builder.new(wizard_id, @user).build if wizard_id
|
||||||
wizard.presence
|
wizard.presence
|
||||||
end
|
end
|
||||||
|
@ -38,7 +38,7 @@ module CustomWizardGuardian
|
||||||
|
|
||||||
submission_data = begin
|
submission_data = begin
|
||||||
submissions = CustomWizard::Submission.list(wizard)
|
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
|
end
|
||||||
|
|
||||||
categories = wizard_actions.map do |action|
|
categories = wizard_actions.map do |action|
|
||||||
|
|
|
@ -517,8 +517,8 @@ class CustomWizard::Action
|
||||||
skip_validations: true,
|
skip_validations: true,
|
||||||
topic_opts: {
|
topic_opts: {
|
||||||
custom_fields: {
|
custom_fields: {
|
||||||
wizard_created: @wizard.id,
|
wizard_id: @wizard.id,
|
||||||
wizard_submission: @wizard.current_submission.id
|
wizard_submission_id: @wizard.current_submission.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,12 +119,12 @@ after_initialize do
|
||||||
|
|
||||||
Liquid::Template.register_filter(::CustomWizard::LiquidFilter::FirstNonEmpty)
|
Liquid::Template.register_filter(::CustomWizard::LiquidFilter::FirstNonEmpty)
|
||||||
|
|
||||||
add_to_class(:topic, :wizard_created) do
|
add_to_class(:topic, :wizard_id) do
|
||||||
custom_fields['wizard_created']
|
custom_fields['wizard_id']
|
||||||
end
|
end
|
||||||
|
|
||||||
add_to_class(:topic, :wizard_submission) do
|
add_to_class(:topic, :wizard_submission_id) do
|
||||||
custom_fields['wizard_submission']
|
custom_fields['wizard_submission_id']
|
||||||
end
|
end
|
||||||
|
|
||||||
add_class_method(:wizard, :user_requires_completion?) do |user|
|
add_class_method(:wizard, :user_requires_completion?) do |user|
|
||||||
|
|
Laden …
In neuem Issue referenzieren