Class: FactoryBot::Strategy::Stub
- Inherits:
-
Object
- Object
- FactoryBot::Strategy::Stub
- Defined in:
- lib/factory_bot/strategy/stub.rb
Constant Summary collapse
- DISABLED_PERSISTENCE_METHODS =
[ :connection, :decrement!, :delete, :destroy!, :destroy, :increment!, :reload, :save!, :save, :toggle!, :touch, :update!, :update, :update_attribute, :update_attributes!, :update_attributes, :update_column, :update_columns, ].freeze
- @@next_id =
1000
Instance Method Summary collapse
Instance Method Details
#association(runner) ⇒ Object
27 28 29 |
# File 'lib/factory_bot/strategy/stub.rb', line 27 def association(runner) runner.run(:build_stubbed) end |
#result(evaluation) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/factory_bot/strategy/stub.rb', line 31 def result(evaluation) evaluation.object.tap do |instance| stub_database_interaction_on_result(instance) clear_changed_attributes_on_result(instance) evaluation.notify(:after_stub, instance) end end |