Skip to content
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

Cannot use coal anymore #1060

Closed
catalanska opened this issue Oct 5, 2015 · 2 comments
Closed

Cannot use coal anymore #1060

catalanska opened this issue Oct 5, 2015 · 2 comments

Comments

@catalanska
Copy link

Hello,

I've been testing latest changes on both coal and engine. I had created a script to fill up my database, but now I am not able to do even simple queries.

As an example:

If I run

client = Locomotive::Coal::Client.new(HOST { email:EMAIL, api_key: API_KEY })
site_client = client.scope_by('warm-tundra-4331')
site_client.contents.photos.all

I get this on server side

 MOPED: 127.0.0.1:27017 QUERY        database=engine_test_dev collection=locomotive_content_types selector={"$query"=>{"site_id"=>BSON::ObjectId('5612ba935583191545000001'), "$or"=>[{"_id"=>"photos"}, {"slug"=>"photos"}]}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 1.5603ms

NoMethodError (undefined method `num_pages' for #<Mongoid::Criteria:0x007f97c854a558>):
  mongoid (4.0.2) lib/mongoid/criteria.rb:523:in `method_missing'
  locomotivecms (3.0.0.pre.beta.1) app/api/locomotive/api/helpers/pagination_helper.rb:7:in `add_pagination_header'
  locomotivecms (3.0.0.pre.beta.1) app/api/locomotive/api/resources/content_entry_resource.rb:34:in `block (2 levels) in <class:ContentEntryResource>'
  grape (0.12.0) lib/grape/endpoint.rb:47:in `call'
  grape (0.12.0) lib/grape/endpoint.rb:47:in `block in generate_api_method'
  grape (0.12.0) lib/grape/endpoint.rb:247:in `call'
  grape (0.12.0) lib/grape/endpoint.rb:247:in `run'

Best

@did
Copy link
Member

did commented Oct 10, 2015

@catalanska, good point. I've fixed it this week. Here is the commit: aff744a

@did did closed this as completed Oct 10, 2015
@catalanska
Copy link
Author

great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants