Closed
Description
It's possible for has_one type of relationships not to return the included record, only the id and the type. But the code expects the entire data to be in the 'included' section. If it's not there you get this error
NoMethodError: undefined method `[]' for nil:NilClass
etc/gems/json_api_client-1.3.0/lib/json_api_client/included_data.rb:43:in `record_for'
There are two tests for this, one expecting the included data, and one without the included data, but they both use stubbed JSON that has the included data. So the tests pass although the code doesn't actually work. When I changed the test so that the test for the case where there's no included data uses stubbed JSON that doesn't have included data, as it should do, then the test fails.
I'm trying to fix this, and might make a PR for it, but if it's a known problem and the fix is due out in the next release then I won't bother.
Metadata
Metadata
Assignees
Labels
No labels