COMPATIBILITY: Add backwards compatibility for category serialization
Dieser Commit ist enthalten in:
Ursprung
21cf81b7a5
Commit
95b0758647
1 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
|
@ -64,6 +64,12 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def categories
|
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
|
||||||
end
|
end
|
||||||
|
|
Laden …
In neuem Issue referenzieren