Comments (8)
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.
@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.
@benbonnet worked for me!
from jsonapi-resources-site.
@CodingItWrong Did you find the issue?
from jsonapi-resources-site.
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.
@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.
Here is the issue about this problem on jsonapi-resources
GitHub.
from jsonapi-resources-site.
@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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonapi-resources-site.