I've been using FactoryGirl for a while now, but still don't know what evaluator means in the after create hook:
factory :products_color_with_variants do
after(:create) do |pc, evaluator|
pc.variants << FactoryGirl.create(:variant)
end
end
I've only been using the first argument to the block, which is always just the object that was created. What does evaluator do and what can I use it for?
This can help you. You can access transient attributes from it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With