Coder Social home page Coder Social logo

Comments (8)

Genkilabs avatar Genkilabs commented on August 19, 2024 2

For those wanting to use '~> 0.10.7' (in my case Rails 5.2.8), you can swap out serialize_to_hash with object_hash but it requires 2 params. The second can be an empty hash.
For a nice TLDR drop-in, check out @xhocquet solution over on the 1149 issue:
cerebris/jsonapi-resources#1149 (comment)

from jsonapi-resources-site.

CodingItWrong avatar CodingItWrong commented on August 19, 2024 1

@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.

from jsonapi-resources-site.

HenrichJones avatar HenrichJones commented on August 19, 2024 1

@benbonnet worked for me!

from jsonapi-resources-site.

soltex1 avatar soltex1 commented on August 19, 2024

@CodingItWrong Did you find the issue?

from jsonapi-resources-site.

soltex1 avatar soltex1 commented on August 19, 2024

Yes, I can confirm that using object_hash instead of serialize_to_hash works. Not sure why a very simple example doesn't work as mentioned in the documentation. Anyway, thanks for your quick reply! :)

from jsonapi-resources-site.

soltex1 avatar soltex1 commented on August 19, 2024

@CodingItWrong Well, it looks like the version 0.10.2 and even the latest one 0.10.5 doesn't contain the method serialize_to_hash, but the master does.

The documentation tells us to add gem 'jsonapi-resources' to the Gemfile which is going to install the 0.10.5, and then they use the method serialize_to_hash in their examples that doesn't exist on that version.

We might have to install the gem directly from the github by adding this line to the Gemfile:

gem 'jsonapi-resources', :git => 'https://github.com/cerebris/jsonapi-resources.git'

Unfortunately, I have a few conflicts with other gems and I wasn't able to test if this works.

from jsonapi-resources-site.

womanonrails avatar womanonrails commented on August 19, 2024

Here is the issue about this problem on jsonapi-resources GitHub.

from jsonapi-resources-site.

benbonnet avatar benbonnet commented on August 19, 2024

@soltex1 can confirm it works with gem 'jsonapi-resources', :git => 'https://github.com/cerebris/jsonapi-resources.git'

from jsonapi-resources-site.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.