1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/lib
Joshua Clayton 0c165ec993 Add DefinitionHierarchy to handle inheritance of some definition attributes
This includes #callbacks, #constructor, and #to_create. The reasoning
behind this is that we were mimicing an inheritance chain via methods;
now, we actually generate classes, which Factory maintains, who inherit
from their parent's hierarchy. We build the hierarchy during compilation
to conditionally define methods based on whether what we're dealing
with from the definition is actually meaningful. The base class
(DefinitionHierarchy) uses the defaults (an empty array for #callbacks
and the global #to_create and #constructor) so once we hit the top
level, if the definition doesn't set any overrides, we have a list of
sensible values.
2012-07-11 23:05:16 -04:00
..
factory_girl Add DefinitionHierarchy to handle inheritance of some definition attributes 2012-07-11 23:05:16 -04:00
factory_girl.rb Add DefinitionHierarchy to handle inheritance of some definition attributes 2012-07-11 23:05:16 -04:00