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

Callback after_destroy in embed doc

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

      Hello,

      I'm using Mongoid 2.3 and Rails 3.1.1

      I have some callbacks in my embed document : After Save and After Destroy.

      The after_save seems to works good.

      But my after_destroy is never raised.

      In my Project Class :
      embeds_many :skills
      accepts_nested_attributes_for :skills, :allow_destroy => true

      In my Skill class :
      embedded_in :project
      after_destroy :delete_tank_indexes

      When I delete a skill, the skills has been deleted, but the callback is not raised...

      I have a strict implementation of this code : http://railscasts.com/episodes/197-nested-model-form-part-2

      Regards,

            Assignee:
            Unassigned Unassigned
            Reporter:
            Florian95 Florian95 [X]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: