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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 6.4.1, 7.0.1
    • Affects Version/s: 6.3.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
              Reporter:
              Jorge Cuadrado
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: