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

one sided many to many array relation is not updated when a related document is deleted

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      class Band
        include Mongoid::Document
        has_and_belongs_to_many :tags, inverse_of: nil
      end
      
      class Tag
        include Mongoid::Document
        field :name, type: String
      end
      

      If I has something like that and I delete a Tag document, the document ID persists in the Band array of tags, if I do a Band.first.tags it shows only the tags that still exists but if I try Band.first.tag_ids it shows all IDS they currently exists or not

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

              Created:
              Updated:
              Resolved: