Class: Backyard::Adapter::FactoryGirl
- Inherits:
-
Backyard::Adapter
- Object
- Backyard::Adapter
- Backyard::Adapter::FactoryGirl
- Defined in:
- lib/backyard/adapter/factory_girl.rb
Instance Method Summary collapse
Methods inherited from Backyard::Adapter
Instance Method Details
#class_for_type(model_type) ⇒ Object
3 4 5 6 7 |
# File 'lib/backyard/adapter/factory_girl.rb', line 3 def class_for_type(model_type) factory = ::Factory.factories[model_type.to_sym] raise ArgumentError, "no factory for: #{model_type}\ngot: #{::Factory.factories.keys}" unless factory factory.build_class end |
#create(model_type, attributes) ⇒ Object
9 10 11 |
# File 'lib/backyard/adapter/factory_girl.rb', line 9 def create(model_type, attributes) Factory(model_type, attributes) end |