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

any_of doesn't work with variable input

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None

      Description

      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?

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: