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

`Critieria` not passing block on to `entries` in `method_missing`

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.10
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      I am still on mongoid 2.x so have only actually tested with that, although I did just take a peek at master and I think the problem is still present there. But apologies if not.

      If you look at Criteria#method_missing, if the method call gets delegated to entries, any block is not passed on. This means things like:

      Foo.all.uniq(&:field_to_be_uniqed)
      

      don't work. Obviously you can just bung a to_a or whatever in there, but obviously one would expect it work without.

      Cheers.

            Assignee:
            Unassigned Unassigned
            Reporter:
            bensymonds Ben Symonds
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: