From c46944dee338ee3fbee69e21e2c7909570d0570e Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 29 Jun 2020 22:50:04 +0800 Subject: [PATCH] Use string keys in example for Deserialization fixes #2384 --- .../adapter/json_api/deserialization.rb | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/active_model_serializers/adapter/json_api/deserialization.rb b/lib/active_model_serializers/adapter/json_api/deserialization.rb index 1af20d94a..b741a75ac 100644 --- a/lib/active_model_serializers/adapter/json_api/deserialization.rb +++ b/lib/active_model_serializers/adapter/json_api/deserialization.rb @@ -25,30 +25,30 @@ module Deserialization # # @example # document = { - # data: { - # id: 1, - # type: 'post', - # attributes: { - # title: 'Title 1', - # date: '2015-12-20' + # 'data' => { + # 'id' => 1, + # 'type' => 'post', + # 'attributes' => { + # 'title' => 'Title 1', + # 'date' => '2015-12-20' # }, - # associations: { - # author: { - # data: { - # type: 'user', - # id: 2 + # 'relationships' => { + # 'author' => { + # 'data' => { + # 'type' => 'user', + # 'id' => 2 # } # }, - # second_author: { - # data: nil + # 'second_author' => { + # 'data' => nil # }, - # comments: { - # data: [{ - # type: 'comment', - # id: 3 + # 'comments' => { + # 'data' => [{ + # 'type' => 'comment', + # 'id' => 3 # },{ - # type: 'comment', - # id: 4 + # 'type' => 'comment', + # 'id' => 4 # }] # } # }