mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Take this serializer:
class TodoSerializer < ActiveModel::Serializer
root :todo, :include => true
has_one :reference, :polymorphic => true
end
A nil reference would generate this JSON:
{
"todo": { "reference": null },
"nil_classes": []
}
This commit prevents the `nil_classes` key from being added when
serializing and including nil polymoprhic associations.
|
||
|---|---|---|
| .. | ||
| association_test.rb | ||
| generators_test.rb | ||
| no_serialization_scope_test.rb | ||
| serialization_test.rb | ||
| serializer_support_test.rb | ||
| serializer_test.rb | ||
| test_helper.rb | ||