FactoryGirl.define do
factory :article do
after_create {|a| a.comments << create(:comment) }
end
factory :comment do
end
end
...it produces this error: Comment(#nnn) expected, got FactoryGirl::Declaration::Static on the after_create line. However, this does work (notice FactoryGirl.create instead of create)...
FactoryGirl.define do
factory :article do
after_create {|a| a.comments << FactoryGirl.create(:comment) }
end
factory :comment do
end
end
'create' works in other places, but within a factory. So I am confused about whether I'm using create incorrectly or if this is a bug.