Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix empty relationships on included resources (#1372)
JSONAPI::ResourceTree#load_included was failing to correctly populate the resource fragments of included resources, such that the `include_related` parameter was null. This was resulting in the relationships object lacking a data attribute for nil or empty resources. The JSON-API specification states that a null or empty array should be returned in these circumstances: https://jsonapi.org/format/#document-resource-object-linkage The underlying issue appears to be the use of `include_related` rather than the symbol `:include_related` when initializing nested resource fragments.
- Loading branch information