Alex Rivera | Logout

Mongoid finders not working?

Asked 2011-01-26T02:21:35.243
32

I have set up a rails3+mongoid application and when I open the rails console, none of the finders seem to work - http://d.pr/FNzC

User.all
User.find(:all, :conditions => { first_name => "John" })

both return:

#<Mongoid::Criteria
  selector: {},
  options:  {}>

Am I doing something wrong?

Edit
Report

1 Answer

1

Try this:

    User.all.first        
    User.find(:first, :conditions => {:first_name => 'John'})    
    User.where(:first_name => 'John').first
answered 2011-01-26T04:51:09.733

Your Answer