factory girl - know when an attribute is overridden in factory
Posted
by
carlos
on Stack Overflow
See other posts from Stack Overflow
or by carlos
Published on 2014-06-13T15:21:39Z
Indexed on
2014/06/13
15:24 UTC
Read the original article
Hit count: 251
factory-girl
Is there any way to determine if attributes are overridden in a factory and adjust the behavior of the factory based on those overrides?
The evaluator passed into the callbacks contains a __override_names__ method. Unfortunately, by the time it is passed to the callback, every attribute configured by the factory is included in the array returned. Moreover, the Evaluator is marked as api private.
© Stack Overflow or respective owner