mongoid/mongoid — pull request #1879 by ahoward (2012-03-30 19:45:58+00:00)
Title: keeping recursion simple keeps it correct

i've been able to trigger StackDepthErrors with significantly sized documents which make use of embedded callbacks. see

http://s3.amazonaws.com/drawohara.com.downloads/fail.tgz

for an example. it's very hard to tigger, so sorry for example size. (see a.rb)

this commit passes all tests *and* fixes the issue above. in summary there simply don't need to be two recursive tree walks: cascadable_children already recurses so we just don't need run_cascading_callbacks