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

Destroying an object leaves HABTM traces

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.2.1
    • Affects Version/s: None
    • Component/s: None

      Given this:

      https://gist.github.com/1205411

      And calling Cake.test and then Cake.nuke will leave the id on the cake.tag_ids field.

      
      >> Cake.test
      true
      >> Cake.nuke
      A
      [#<Tag _id: 4e6985c1662e0c597f000004, name: "chocolate", _type: nil, cake_ids: [BSON::ObjectId('4e6985c1662e0c597f000003')]>]
      B
      [#<Tag _id: 4e6985c1662e0c597f000004, name: "chocolate", _type: nil, cake_ids: [BSON::ObjectId('4e6985c1662e0c597f000003')]>]
      C
      [BSON::ObjectId('4e6985c1662e0c597f000004')]
      nil
      >> Cake.first
      #<Cake _id: 4e6985c1662e0c597f000003, _type: nil, tag_ids: [BSON::ObjectId('4e6985c1662e0c597f000004')]>
      >> Tag.first
      nil
      

      Is this a bug or expected behaviour?

            Assignee:
            Unassigned Unassigned
            Reporter:
            wulffeld Martin Moen Wulffeld
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: