mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Adjusts JsonApi adapter to serialize relationships in a nested relationships hash
This commit is contained in:
@@ -33,10 +33,10 @@ module ActiveModel
|
||||
title: "Hello!!",
|
||||
body: "Hello, world!!"
|
||||
},
|
||||
links: {
|
||||
comments: { linkage: [] },
|
||||
blog: { linkage: { type: "blogs", id: "999" } },
|
||||
author: { linkage: { type: "authors", id: "1" } }
|
||||
relationships: {
|
||||
comments: { data: [] },
|
||||
blog: { data: { type: "blogs", id: "999" } },
|
||||
author: { data: { type: "authors", id: "1" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -46,10 +46,10 @@ module ActiveModel
|
||||
title: "New Post",
|
||||
body: "Body"
|
||||
},
|
||||
links: {
|
||||
comments: { linkage: [] },
|
||||
blog: { linkage: { type: "blogs", id: "999" } },
|
||||
author: { linkage: { type: "authors", id: "1" } }
|
||||
relationships: {
|
||||
comments: { data: [] },
|
||||
blog: { data: { type: "blogs", id: "999" } },
|
||||
author: { data: { type: "authors", id: "1" } }
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -67,10 +67,10 @@ module ActiveModel
|
||||
attributes: {
|
||||
title: "Hello!!"
|
||||
},
|
||||
links: {
|
||||
comments: { linkage: [] },
|
||||
blog: { linkage: { type: "blogs", id: "999" } },
|
||||
author: { linkage: { type: "authors", id: "1" } }
|
||||
relationships: {
|
||||
comments: { data: [] },
|
||||
blog: { data: { type: "blogs", id: "999" } },
|
||||
author: { data: { type: "authors", id: "1" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -79,10 +79,10 @@ module ActiveModel
|
||||
attributes: {
|
||||
title: "New Post"
|
||||
},
|
||||
links: {
|
||||
comments: { linkage: [] },
|
||||
blog: { linkage: { type: "blogs", id: "999" } },
|
||||
author: { linkage: { type: "authors", id: "1" } }
|
||||
relationships: {
|
||||
comments: { data: [] },
|
||||
blog: { data: { type: "blogs", id: "999" } },
|
||||
author: { data: { type: "authors", id: "1" } }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user