Class: FactoryGirl::Strategy::Stub

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

Overview

:nodoc:

Constant Summary collapse

@@next_id =
1000

Instance Method Summary collapse

Methods inherited from FactoryGirl::Strategy

ensure_strategy_exists!

Instance Method Details

#association(runner) ⇒ Object



6
7
8
# File 'lib/factory_girl/strategy/stub.rb', line 6

def association(runner)
  runner.run(Strategy::Stub)
end

#result(attribute_assigner, to_create) ⇒ Object



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

def result(attribute_assigner, to_create)
  attribute_assigner.object.tap do |result_instance|
    stub_database_interaction_on_result(result_instance)
    run_callbacks(:after_stub, result_instance)
  end
end