From 0606b06abd78ea92942343a14f72b792d8afea56 Mon Sep 17 00:00:00 2001 From: Brendon Muir Date: Wed, 21 Sep 2016 05:38:53 +1200 Subject: [PATCH] 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. --- docs/howto/upgrade_from_0_8_to_0_10.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/howto/upgrade_from_0_8_to_0_10.md b/docs/howto/upgrade_from_0_8_to_0_10.md index ed1eb453..12303d14 100644 --- a/docs/howto/upgrade_from_0_8_to_0_10.md +++ b/docs/howto/upgrade_from_0_8_to_0_10.md @@ -57,6 +57,8 @@ ActiveModel::ArraySerializer.new(resources, root: "resources") - No default serializer when serializer doesn't exist - `@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