1
0
Fork 0

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