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:
@@ -30,9 +30,9 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def test_includes_bio_id
|
||||
expected = { linkage: { type: "bios", id: "43" } }
|
||||
expected = { data: { type: "bios", id: "43" } }
|
||||
|
||||
assert_equal(expected, @adapter.serializable_hash[:data][:links][:bio])
|
||||
assert_equal(expected, @adapter.serializable_hash[:data][:relationships][:bio])
|
||||
end
|
||||
|
||||
def test_includes_linked_bio
|
||||
@@ -46,8 +46,8 @@ module ActiveModel
|
||||
content:"AMS Contributor",
|
||||
rating: nil
|
||||
},
|
||||
links: {
|
||||
author: { linkage: { type: "authors", id: "1" } }
|
||||
relationships: {
|
||||
author: { data: { type: "authors", id: "1" } }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user