0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 18:50:27 +01:00

COMPATIBILITY: categories are being loaded differently on Site model

See 0e4b8c5318
Dieser Commit ist enthalten in:
angusmcleod 2021-06-25 11:45:22 +10:00
Ursprung 582b9d82aa
Commit 5a6856fcff

Datei anzeigen

@ -8,11 +8,11 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
:completed, :completed,
:required, :required,
:permitted, :permitted,
:uncategorized_category_id :uncategorized_category_id,
:categories
has_many :steps, serializer: ::CustomWizard::StepSerializer, embed: :objects has_many :steps, serializer: ::CustomWizard::StepSerializer, embed: :objects
has_one :user, serializer: ::BasicUserSerializer, embed: :objects has_one :user, serializer: ::BasicUserSerializer, embed: :objects
has_many :categories, serializer: ::BasicCategorySerializer, embed: :objects
has_many :groups, serializer: ::BasicGroupSerializer, embed: :objects has_many :groups, serializer: ::BasicGroupSerializer, embed: :objects
def completed def completed
@ -56,4 +56,8 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
def include_uncategorized_category_id? def include_uncategorized_category_id?
object.needs_categories object.needs_categories
end end
def categories
object.categories.map { |c| c.to_h }
end
end end