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

current_user and user_signed_in? does not work with mongoid and rails 4.1.0 with devise #2980

Closed
santa-1987 opened this issue Apr 16, 2014 · 2 comments

Comments

@santa-1987
Copy link

I get the error while trying to fetch current_user in ruby 2.1.1 and rails 4.1.0

[2] pry(#<#<Class:0x0000000662bbe0>>)> current_user
  MOPED: 127.0.0.1:27017 QUERY        database=htmlgen_development collection=users selector={"$query"=>{"_id"=>{"$oid"=>BSON::ObjectId('534e21e57573651144000000')}}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 1.3477ms
Moped::Errors::QueryFailure: The operation: #<Moped::Protocol::Query
  @length=124
  @request_id=4
  @response_to=0
  @op_code=2004
  @flags=[]
  @full_collection_name="htmlgen_development.users"
  @skip=0
  @limit=-1
  @selector={"$query"=>{"_id"=>{"$oid"=>BSON::ObjectId('534e21e57573651144000000')}}, "$orderby"=>{:_id=>1}}
  @fields=nil>
failed with error 10068: "invalid operator: $oid"

See https://github.com/mongodb/mongo/blob/master/docs/errors.md
for details about this error.
from /home/usermac44/.rvm/gems/ruby-2.1.1@htmlgen/gems/moped-2.0.0.rc1/lib/moped/operation/read.rb:50:in `block in execute'

I use Gems:

gem 'devise', github: 'plataformatec/devise'
gem 'mongoid', github: 'mongoid/mongoid'
gem 'bson_ext'

Tried with all of the versions available for devise including lm-rails-4
Let us Know the Solution for this.

Thanks in advance !!!

@laurocaetano
Copy link
Contributor

I guess it's a dup of #2882

right?

@rafaelfranca
Copy link
Collaborator

Right. Closing

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

No branches or pull requests

3 participants