mongoid/mongoid — Issue #1339: Callback after_destroy in embed doc
Author: Florian95
Created: 2011-10-10 20:31:26+00:00
State: open

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,