Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +01:00
FIX: serializer associations
Dieser Commit ist enthalten in:
Ursprung
79dcacf451
Commit
3825d2dba9
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
|
@ -7,9 +7,9 @@ class CustomWizardFieldSerializer < ::WizardFieldSerializer
|
||||||
:file_types,
|
:file_types,
|
||||||
:limit,
|
:limit,
|
||||||
:property
|
:property
|
||||||
|
|
||||||
|
has_many :choices, serializer: WizardFieldChoiceSerializer, embed: :objects
|
||||||
|
|
||||||
has_many :fields, serializer: CustomWizardFieldSerializer, embed: :objects
|
|
||||||
|
|
||||||
def label
|
def label
|
||||||
return object.label if object.label.present?
|
return object.label if object.label.present?
|
||||||
I18n.t("#{object.key || i18n_key}.label", default: '')
|
I18n.t("#{object.key || i18n_key}.label", default: '')
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
class ::CustomWizardStepSerializer < ::WizardStepSerializer
|
class ::CustomWizardStepSerializer < ::WizardStepSerializer
|
||||||
|
|
||||||
attributes :permitted, :permitted_message
|
attributes :permitted, :permitted_message
|
||||||
|
has_many :fields, serializer: ::CustomWizardFieldSerializer, embed: :objects
|
||||||
|
|
||||||
def title
|
def title
|
||||||
return PrettyText.cook(object.title) if object.title
|
return PrettyText.cook(object.title) if object.title
|
||||||
|
|
Laden …
In neuem Issue referenzieren