mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Update upgrade_from_0_8_to_0_10.md (#1933)
Update upgrade_from_0_8_to_0_10.md Changes the upgrade guide to highlight the change in the way relationships are walked.
This commit is contained in:
parent
a77dfdaa85
commit
0606b06abd
@ -57,6 +57,8 @@ ActiveModel::ArraySerializer.new(resources, root: "resources")
|
|||||||
|
|
||||||
- No default serializer when serializer doesn't exist
|
- No default serializer when serializer doesn't exist
|
||||||
- `@options` changed to `instance_options`
|
- `@options` changed to `instance_options`
|
||||||
|
- Nested relationships are no longer walked by default. Use the `:include` option at **controller `render`** level to specify what relationships to walk. E.g. `render json: @post, include: {comments: :author}` if you want the `author` relationship walked, otherwise the json would only include the post with comments. See: https://github.com/rails-api/active_model_serializers/pull/1127
|
||||||
|
- To emulate `0.8`'s walking of arbitrarily deep relationships use: `include: '**'`. E.g. `render json: @post, include: '**'`
|
||||||
|
|
||||||
## Steps to migrate
|
## Steps to migrate
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user