Add default_includes configuration

This is useful to set application-wide default behavior - e.g. in
previous versions of AMS the default behavior was to serialize the
full object graph by default - equivalent to the '**' include tree.

Currently just the global setting, but I think this could also work
on a per-serializer basis, with more attention.
This commit is contained in:
Ben Woosley
2016-01-12 12:05:11 -08:00
committed by Noah Silas
parent a701777bd5
commit 8c18d18cdb
7 changed files with 132 additions and 38 deletions

View File

@@ -52,10 +52,12 @@ Each adapter has a default key transform configured:
`config.key_transform` is a global override of the adapter default. Adapters
still prefer the render option `:key_transform` over this setting.
##### default_includes
What relationships to serialize by default. Default: `'*'`, which includes one level of related
objects. See [includes](adapters.md#included) for more info.
## JSON API
##### jsonapi_resource_type
Sets whether the [type](http://jsonapi.org/format/#document-resource-identifier-objects)