Adjusts JsonApi adapter to serialize relationships in a nested relationships hash

This commit is contained in:
Benedikt Deicke
2015-05-21 16:35:35 +02:00
parent ca41901fb8
commit 4f576a1463
9 changed files with 150 additions and 150 deletions

View File

@@ -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" } }
}
}
]