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

embeds_many set to empty array performs unset

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.1.0
    • Component/s: Associations
    • Labels:
      None

      when I try to set an embeds_many relation to an empty array, it removes the embedded relation from the document and it's not tracking the changes anymore, which is not desired, as there was a change on the document. Also this causes inconsistencies in the data as the data is lost and there is no way to know that it was unset. 

      I read through some closed issues and apparently this is somehow a known behaviour, is there any way to prevent this from happening ? 

      Some background: 

      We are tracking the changes on objects and it's important to know if there was a change on the associations as well. 

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            milad.rezazadeh@finlex.de Milad Rezazadeh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: