8

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?

1 Answer 1

8

This can help you. You can access transient attributes from it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.