mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Fix example in docs/general/deserialization.md.
This commit is contained in:
parent
63e93375e3
commit
4c0e2dcb28
@ -35,30 +35,30 @@ Given a JSON API document,
|
|||||||
|
|
||||||
```
|
```
|
||||||
document = {
|
document = {
|
||||||
data: {
|
'data' => {
|
||||||
id: 1,
|
'id' => 1,
|
||||||
type: 'post',
|
'type' => 'post',
|
||||||
attributes: {
|
'attributes' => {
|
||||||
title: 'Title 1',
|
'title' => 'Title 1',
|
||||||
date: '2015-12-20'
|
'date' => '2015-12-20'
|
||||||
},
|
},
|
||||||
associations: {
|
'associations' => {
|
||||||
author: {
|
'author' => {
|
||||||
data: {
|
'data' => {
|
||||||
type: 'user',
|
'type' => 'user',
|
||||||
id: 2
|
'id' => '2'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
second_author: {
|
'second_author' => {
|
||||||
data: nil
|
'data' => nil
|
||||||
},
|
},
|
||||||
comments: {
|
'comments' => {
|
||||||
data: [{
|
'data' => [{
|
||||||
type: 'comment',
|
'type' => 'comment',
|
||||||
id: 3
|
'id' => '3'
|
||||||
},{
|
},{
|
||||||
type: 'comment',
|
'type' => 'comment',
|
||||||
id: 4
|
'id' => '4'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user