Updating the meta key documentation to warn users that { root: false } will cause the serializer to ignore the meta key as it leads to invalid JSON.

https://github.com/rails-api/active_model_serializers/issues/332
This commit is contained in:
Logan Serman 2013-06-16 01:01:03 -05:00
parent 4f185efa90
commit b20ad33407

View File

@ -351,6 +351,9 @@ The above usage of `:meta_key` will produce the following:
}
```
When using meta information, your serializer cannot have the `{ root: false }` option, as this would lead to
invalid JSON. If you do not have a root key, the meta information will be ignored.
If you would like direct, low-level control of attribute serialization, you can
completely override the `attributes` method to return the hash you need: