You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#look in included data
if relationship_definitions.key?("data")
return last_result_set.included.data_for(method, relationship_definitions)
end
This code checks for the relationships array relationship_definitions.key?("data"), and calls last_result_set.included that returns #<JsonApiClient::IncludedData:0x0055e4e47cf398 @data={}> , which generates the exception above.
Why not checking the included data instead of the relationships only?
I have a response where
relationships
contains some data, but they're not included as a compound document.when I try to access
book.chapters
I getNoMethodError: undefined method [] for nil:NilClass
https://github.com/chingor13/json_api_client/blob/master/lib/json_api_client/resource.rb#L445
This code checks for the relationships array
relationship_definitions.key?("data")
, and callslast_result_set.included
that returns#<JsonApiClient::IncludedData:0x0055e4e47cf398 @data={}>
, which generates the exception above.Why not checking the included data instead of the relationships only?
Here the backtrace:
The text was updated successfully, but these errors were encountered: