Skip to content
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

Fix confusing error when using include and no relationship was set #283

Merged
merged 1 commit into from Aug 23, 2018

Conversation

aledalgrande
Copy link
Contributor

If you forgot to set any has_many in the serializer and tried to serialize with an include you would get:

NoMethodError (undefined method `[]' for nil:NilClass):

(no backtrace from the gem) That is not very helpful.

Setting the variable with a default case makes sure the right error message gets displayed.

If you forgot to set any `has_many` in the serializer and tried to serialize with an `include` you would get:
```
NoMethodError (undefined method `[]' for nil:NilClass):
```

That is not very helpful. Setting the variable with a default case makes sure the right error message gets displayed.
@aledalgrande
Copy link
Contributor Author

Is this project still maintained?

@shishirmk
Copy link
Collaborator

@aledalgrande it is maintained. I will take a look at your fix this week and give you a reply.

@shishirmk
Copy link
Collaborator

@aledalgrande thanks for the fix.

@shishirmk shishirmk merged commit 42d9203 into Netflix:dev Aug 23, 2018
@shishirmk
Copy link
Collaborator

Released in Version 1.4

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.

None yet

2 participants