Adds polymorphic tests and documentation

This commit is contained in:
Marc Garreau
2016-03-15 12:20:00 -06:00
parent 54ddbe2851
commit 045fa9bc07
5 changed files with 114 additions and 0 deletions

View File

@@ -76,6 +76,18 @@ def blog
end
```
### Polymorphic Relationships
Polymorphic relationships are serialized by specifying the relationship, like any other association. For example:
```ruby
class PictureSerializer < ActiveModel::Serializer
has_one :imageable
end
```
For more context, see the [tests](../../test/adapter/polymorphic_test.rb) for each adapter.
### Caching
#### ::cache