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

any_of doesn't work with variable input

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

      I don't always know at write time what will go into an any_of query, but I can't do this:
      arr = [{:condition1 => "foo"}, {:condition2 => "bar"}]
      MyClass.any_of(arr)

      1. nor
        MyClass.any_of(*arr)
      1. Expected:
        MyClass.any_of(arr) == MyClass.any_of({:condition1 => "foo"}, {:condition2 => "bar"})
        Suggestions? Or maybe checking for an array arg could be patched in?

            Assignee:
            Unassigned Unassigned
            Reporter:
            nanodeath Max Aller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: