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

Fix nested symbol operator during Selector.merge!()

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.2.1
    • Component/s: Query
    • None

      Selector.merge!() incorrectly handles nested Hash's containing `$in` and `$nin` operators, where one operator is a String and the other is a Symbol. This PR fixes this issue, along with unit tests that repro the problem behavior in the old code.

      This change was originally inspired by a Symbol-String bug manifesting in a chained Query.where().where(). A key cause of this bug was in Selector.merge!(). The second change which fixes the higher level Query.where().where() bug is part of a different module (Storable vs. Selector). I will be submitting that fix + test case(s) in a separate PR.

      The PR is already ready to be reviewed/merged: https://github.com/mongodb/mongoid/pull/4965

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            dalton.black@braze.com Dalton Black
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: