0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-13 05:32:53 +01:00

COMPATIBILITY: Add backwards compatibility for category serialization

Dieser Commit ist enthalten in:
angusmcleod 2021-10-05 10:07:21 +08:00
Ursprung 21cf81b7a5
Commit 95b0758647

Datei anzeigen

@ -64,6 +64,12 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
end
def categories
object.categories.map { |c| c.to_h }
object.categories.map do |category|
if category.respond_to?(:to_h)
category.to_h
else
::BasicCategorySerializer.new(category).as_json
end
end
end
end