Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50:27 +01:00
Add more checks for edgecases (e.g. when user_field is removed)
Dieser Commit ist enthalten in:
Ursprung
5f07814f0e
Commit
454872edc8
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
|
@ -258,7 +258,9 @@ class CustomWizard::Builder
|
||||||
}
|
}
|
||||||
).perform
|
).perform
|
||||||
|
|
||||||
if content.present?
|
if content.present? &&
|
||||||
|
content[:result].present?
|
||||||
|
|
||||||
if content[:type] == 'association'
|
if content[:type] == 'association'
|
||||||
content[:result] = content[:result].map do |item|
|
content[:result] = content[:result].map do |item|
|
||||||
{
|
{
|
||||||
|
|
|
@ -188,7 +188,7 @@ class CustomWizard::Mapper
|
||||||
|
|
||||||
def map_user_field_options(value)
|
def map_user_field_options(value)
|
||||||
if value.include?(User::USER_FIELD_PREFIX)
|
if value.include?(User::USER_FIELD_PREFIX)
|
||||||
if field = UserField.find(value.split('_').last)
|
if field = UserField.find_by(id: value.split('_').last)
|
||||||
field.user_field_options.map(&:value)
|
field.user_field_options.map(&:value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Laden …
In neuem Issue referenzieren