rails-api/active_model_serializers — pull request #376 by uorbe001 (2013-08-20 15:20:51+00:00)
Title: Adds support for polymorphic has_many associations

This adds support for has_many polymorphic associations to active_model_serializers.

For an ```Attachment``` model with many ```Attachable``` models associated, where an ```Email``` extends the ```Attachable``` model, the output would be something like this:

```
{
"attachment": {
"name": 'logo.png',
"url": 'http://example.com/logo.png',
"attachable_ids": [{
"type": "email",
"id": 1
}]
},
"emails": [{
"id": 1,
"subject": "foo",
"body": "bar"
}]
}
```