Class: FactoryGirl::Proxy::Create

Inherits:
Build show all
Defined in:
lib/factory_girl/proxy/create.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Build

#association, #get, #initialize, #set

Methods inherited from FactoryGirl::Proxy

#association, ensure_strategy_exists!, #get, #initialize, #method_missing, #run_callbacks, #set, #set_ignored

Constructor Details

This class inherits a constructor from FactoryGirl::Proxy::Build

Dynamic Method Handling

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

Instance Method Details

#result(to_create) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/factory_girl/proxy/create.rb', line 4

def result(to_create)
  super

  to_create ||= lambda {|instance| instance.save! }
  to_create[@instance]

  run_callbacks(:after_create)
  @instance
end