active_model_serializers/lib
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
..
action_controller Allows serialization_scope to be disabled with serialization_scope nil 2012-06-05 12:37:09 -04:00
active_model Don't include empty polymoprhic associations 2012-07-16 15:08:01 +02:00
generators Always add :id to attributes 2012-06-05 10:05:06 +02:00
active_model_serializers.rb move array_serializer logic to active_model_serializer.rb 2012-07-10 10:23:45 +08:00