docs/general/deserialization.md in active_model_serializers-0.10.0.rc5 vs docs/general/deserialization.md in active_model_serializers-0.10.0
- old
+ new
@@ -33,33 +33,33 @@
Given a JSON API document,
```
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
+ 'associations' => {
+ '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'
}]
}
}
}
}