Class: FactoryGirl::Proxy::Build

Inherits:
FactoryGirl::Proxy show all
Defined in:
lib/factory_girl/proxy/build.rb

Overview

:nodoc:

Direct Known Subclasses

Create

Instance Method Summary collapse

Methods inherited from FactoryGirl::Proxy

ensure_strategy_exists!, #initialize, #run_callbacks

Constructor Details

This class inherits a constructor from FactoryGirl::Proxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FactoryGirl::Proxy

Instance Method Details

#association(factory_name, overrides = {}) ⇒ Object



4
5
6
7
# File 'lib/factory_girl/proxy/build.rb', line 4

def association(factory_name, overrides = {})
  factory = FactoryGirl.factory_by_name(factory_name)
  factory.run(get_method(overrides[:method]), overrides.except(:method))
end

#result(to_create) ⇒ Object



9
10
11
12
# File 'lib/factory_girl/proxy/build.rb', line 9

def result(to_create)
  run_callbacks(:after_build)
  result_instance
end