Class: FactoryGirl::Strategy::Create

Inherits:
FactoryGirl::Strategy show all
Defined in:
lib/factory_girl/strategy/create.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from FactoryGirl::Strategy

ensure_strategy_exists!

Instance Method Details

#association(runner) ⇒ Object



4
5
6
# File 'lib/factory_girl/strategy/create.rb', line 4

def association(runner)
  runner.run
end

#result(attribute_assigner, to_create) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/factory_girl/strategy/create.rb', line 8

def result(attribute_assigner, to_create)
  attribute_assigner.object.tap do |result_instance|
    run_callbacks(:after_build, result_instance)
    to_create[result_instance]
    run_callbacks(:after_create, result_instance)
  end
end