Class: FactoryBotFactory::ModelFactory
- Inherits:
-
BaseFactory
- Object
- BaseFactory
- FactoryBotFactory::ModelFactory
- Defined in:
- lib/factory_bot_factory/factories/model_factory.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from BaseFactory
Constructor Details
This class inherits a constructor from FactoryBotFactory::BaseFactory
Instance Method Details
#build_factory(name, value, level, _options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/factory_bot_factory/factories/model_factory.rb', line 3 def build_factory(name, value, level, = {}) output = LineWriter.wrap_factory(name, value.class.name) do inner_output = [] value.attributes.each do |key, value| inner_output += build_nested_attribute(value.class.name, key, value, 1, 1) end inner_output end output end |