1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/lib/factory_bot/strategy/create.rb

19 lines
423 B
Ruby
Raw Normal View History

module FactoryBot
module Strategy
class Create
def association(runner)
runner.run
2012-02-08 09:56:04 -05:00
end
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
2008-12-23 14:03:29 -05:00
end
end
end
end