Class: FactoryBotFactory::Base
- Inherits:
-
Object
- Object
- FactoryBotFactory::Base
- Defined in:
- lib/factory_bot_factory/base.rb
Class Method Summary collapse
Class Method Details
.build(factory_name, klass, data, options = {}) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/factory_bot_factory/base.rb', line 4 def build(factory_name, klass, data, = {}) raise NestedToDeepError, 'Only support 5 nested levels' if [:nested_level].to_i > 5 factory(klass, data).new(.merge(factory_name: factory_name)).generate(data) rescue => e puts "Please check your input data and make sure you pass supported type of factory." end |