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

set modifier method don't persist change with a empty hash

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 6.4.1, 7.0.1
    • Affects Version/s: 6.3.0
    • Component/s: None
    • Labels:
      None

      I'm updating from mongoid5.1.4 to mongoid6.3 and I found this change of behavior

      I use obj.set(hash_field: {}) to reset some values but they don't get change in the database

      obj.set(hash_field: {})
      obj.hash_field
      > {}
      obj.reload.hash_field
      > {:a=>1}

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            kuadrosx Jorge Cuadrado
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: