-
Notifications
You must be signed in to change notification settings - Fork 40
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
Undefined method serialize_to_hash
on Serializer page
#53
Comments
@CodingItWrong Did you find the issue? |
@soltex1 I didn't figure out the correct changes to make on the page, no, so I wasn't able to do a PR to update it. As for the issue in the code itself, the alternate approach I mentioned above did work. |
Yes, I can confirm that using |
@CodingItWrong Well, it looks like the version 0.10.2 and even the latest one 0.10.5 doesn't contain the method The documentation tells us to add We might have to install the gem directly from the github by adding this line to the Gemfile:
Unfortunately, I have a few conflicts with other gems and I wasn't able to test if this works. |
Here is the issue about this problem on |
@soltex1 can confirm it works with |
@benbonnet worked for me! |
For those wanting to use |
guide/serializer.html
suggests that we can do:But when I do the equivalent in 0.10.2, I get the error:
Looking through the source of
JSONAPI::ResourceSerializer
,#object_hash
seems to be the currently-available method that meets that need. The code succeeds for me with the following change:(Note that
#object_hash
takes two arguments, so we passnil
for the second.)I would PR this change to the page, but I'm unsure of the correct changes for the rest of the page.
The text was updated successfully, but these errors were encountered: