1
0
Fork 0

FIX: serializer associations

Dieser Commit ist enthalten in:
Angus McLeod 2019-12-13 09:54:13 +11:00
Ursprung 79dcacf451
Commit 3825d2dba9
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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: '')

Datei anzeigen

@ -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