JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

no implicit conversion of Symbol into Integer error using mongoid

Open
#589 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.