Callback defined in a trait and used by a subfactory is called twice #393

eric-smartlove opened this Issue Jun 19, 2012 · 2 comments


None yet

2 participants


I had a problem when I update FactoryGirl from 3.3.0 to 3.4.1.

I isolated the problem here :

With FactoryGirl 3.3.0 all these tests are passing.
With FactoryGirl 3.4.1, the third test (the last one) fails.

It seems that when a callback is defined in a trait that is used by a subfactory (nested factory) it is called twice.

Maybe I misuse FactoryGirl but what I am doing wrong is not obvious to me.


@eric-smartlove Thanks for reporting this! I confirmed the bug and fixed it in the above commit. I've also cut version 3.4.2 of the gem. Grab a copy and let me know if you see any other issues!



It's ok with FactoryGirl 3.4.2, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment