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

Unable to prevent deletion of embedded doc after upgrade

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: None
    • Labels:

      Description

      Related to this: https://github.com/mongoid/mongoid/issues/1063

      In 2.4 in a before_destroy callback on an embedded doc, I could return false if I didn't want the destroy to proceed. This was called on nested attribute updates using a _destroy=1. This is useful if for example you don't want the last embedded doc in an embeds_many to be deletable.

      In 2.4.9 returning false does not prevent the delete.

      I've tried Paranoia as well, but callbacks are not called at all, on updates with _destroy=1

        Attachments

          Activity

            People

            Assignee:
            durran Durran Jordan
            Reporter:
            nader Nader Akhnoukh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: