-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I think this problem is related to MONGOID-1888
I'm using mongoid-tree like the related issue and I'm getting the error {{NoMethodError (undefined method }}_run_rearrange_callbacks' for #<Ingredient:0x007f91343cea20>):`
In this case Ingredient is an embed document and I have cascading callbacks on it. The problem only seems to happen when I try to destroy an embed document using _destroy in the parent's _attributes. In my simple debugging of the situation I think what is happening is the children array in cascadable_children is adding the embed model because it responds to validation and so even though it doesn't respond to rearrange it still is in the array and the callbacks get added. I'm not 100% sure how all this works so I might be wrong.