JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
no implicit conversion of Symbol into Integer error using mongoid
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.3k
- Forks
- 546
- PR merge metrics
- No merged PRs in 30d
Description
Just upgraded to mongoid 5.0.2 and mongo 2.2.1 using latest release of jsonapi-resources 0.7 after which I began receiving a no implicit conversion of Symbol into Integer error.
This is due to lib/jsonapi/resource.rb:551 count(:all) is passing a Symbol to a delegated count method within mongo which expects a Hash.
It appears the bug to count() was caused by a change related to postgres support in d0e35b69caf953e00068edd9e09cce80caf5dddf
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/jsonapi/resource.rb:551 and inspect the count(:all) call and the delegated MongoDB count behavior described in the issue. Review commit d0e35b69caf953e00068edd9e09cce80caf5dddf for the PostgreSQL-related change, then verify that counting works with Mongoid 5.0.2 and Mongo 2.2.1 without passing a Symbol where a Hash is expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, ruby
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100