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

update_attributes doesn't save deletes for a references_and_referenced_in_many relationship

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

      rc8

      I have a many-to-many relationship between Exhibitor and Artwork.

      class Exhibitor
      ...
      references_and_referenced_in_many :artworks
      end

      • create(hash) where hash contains artworks = [ array of ids ] -> success
      • update_attributes(hash) where hash contains artworks = [ array of ids, with several new ids ] -> success
      • update_attributes(hash) where hash contains artworks = [ array of ids, with removed ids ] -> fail

      By fail I mean nothing is removed.

      http://groups.google.com/group/mongoid/browse_thread/thread/0b685e1895bb64a6

            Assignee:
            Unassigned Unassigned
            Reporter:
            dblock Daniel Doubrovkine
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: