-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:
class Parent include Mongoid::Document embeds_many :children, cascade_callbacks: true # uncommenting this is a work around to get the callbacks to fire # before_destroy :destroy_children # private # def destroy_children # children.each(&:destroy) # end end class Child include Mongoid::Document before_destroy lambda { puts "before destroy" } # never fires after_destroy lambda { puts "after destroy" } # never fires end
This used to be a bug for a long time in 2.x. So I always used that work around provided in the comments. Only recently did I take away the work around to rely on cascade_callbacks instead.
Lo and behold when I now decided to move up to 3.x the bug was back