rails/rails — pull request #12469 by arthurnn (2013-10-08 19:19:17+00:00)
Title: make cycle detection on autosave works on a thread level

Fixes `stack level too deep` error when creating a children object on a parent callback.
This error was only happening when the inverse_of relation was set.

[related #12413]

review @rafaelfranca @tenderlove

(I will submit another patch for 3.2 in a second)