Skip to content

Fix including with blank relationships #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

stokarenko
Copy link
Contributor

It fixes the minor breaking change introduced by 3048ea3#diff-cd00f457f4dd1dac9e58ef9c63390ca1R514:

Given: user = DocumentUser.includes('file').find(1).first
When: resource is coming with blank relationships['file'] json-api data
Expected: user.file to be nil
Actual: the exception raised

NoMethodError: undefined method []' for nil:NilClass json_api_client/lib/json_api_client/resource.rb:549:in relationship_data_for'

@stokarenko
Copy link
Contributor Author

@gaorlov Hi again )

@stokarenko stokarenko force-pushed the fix-including-with-blank-relationships branch from 248feaa to a3544c3 Compare June 25, 2019 18:02
@gaorlov
Copy link
Collaborator

gaorlov commented Jun 25, 2019

hahaha! perfect. Can you update the change log and i'll push out 1.12.2.

Thanks!

@stokarenko
Copy link
Contributor Author

done! )

@stokarenko
Copy link
Contributor Author

I see, fixing, 10 mins )

@stokarenko stokarenko force-pushed the fix-including-with-blank-relationships branch from a3544c3 to 2483f48 Compare June 25, 2019 18:19
@gaorlov gaorlov merged commit f328779 into JsonApiClient:master Jun 25, 2019
@gaorlov
Copy link
Collaborator

gaorlov commented Jun 25, 2019

@stokarenko 1.12.2 is live. Thanks once again!

@gaorlov
Copy link
Collaborator

gaorlov commented Jul 3, 2019

1.14.0 is live. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants