active_model_serializers/lib/active_model
twinturbo 6f3b250dc9 Don't include empty polymoprhic associations
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.
2012-07-16 15:08:01 +02:00
..
serializers Prep for 0.5.0 2012-05-16 14:17:10 -07:00
serializer.rb Don't include empty polymoprhic associations 2012-07-16 15:08:01 +02:00