FactoryGirl: Populate a has many relation preserving build strategy
My problem seems very common, but I haven't found any answer in the documentation or the internet itself. It might seem a clone of this question has_many while respecting build strategy in factory_girl but 2,5 years after that post factory_girl changed a lot. I have a model with a has_many relation called photos. I want to populate this has many relation preserving my choice of build strategy. If I call offering = FactoryGirl.build_stubbed :offering, :stay I expect offering.photos to be a collection of stubbed models. The only way i've found to achieve this is this one: factory :offering do