Class: FactoryGirl::Strategy::Create

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_girl/strategy/create.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) association(runner)



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

def association(runner)
  runner.run
end

- (Object) result(evaluation)



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

def result(evaluation)
  evaluation.object.tap do |instance|
    evaluation.notify(:after_build, instance)
    evaluation.notify(:before_create, instance)
    evaluation.create(instance)
    evaluation.notify(:after_create, instance)
  end
end