Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2824

ArgumentError when using find_by

      When I am using find_by or where().first, it raises ArgumentError

      Loading development environment (Rails 3.2.11)
      [1] pry(main)> u = User.find_by(email: 'dante@aftership.com')
      ArgumentError: wrong number of arguments (1 for 0)
      from /Users/Dante/.rvm/gems/ruby-1.9.3-p385/gems/mongoid-3.0.22/lib/mongoid/extensions/array.rb:77:in `mongoize'
      [2] pry(main)> u = User.where(email: 'dante@aftership.com')
      => #<Mongoid::Criteria
        selector: {"email"=>"dante@aftership.com"}
        options:  {}
        class:    User
        embedded: false>
      
      [3] pry(main)> u = User.where(email: 'dante@aftership.com').first
      ArgumentError: wrong number of arguments (1 for 0)
      from /Users/Dante/.rvm/gems/ruby-1.9.3-p385/gems/mongoid-3.0.22/lib/mongoid/extensions/array.rb:77:in `mongoize'
      [2] pry(main)> 
      

      I am running Mongoid 3.0.22

      Thanks.

            Assignee:
            durran Durran Jordan
            Reporter:
            dantetwc dantetwc
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: