You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you provide more insight into what part doesn't actually work?
The documentation that is specified is given primarily as a way for you to provide a number of how many of the associated records you'd like to create. The way you have it above works great but is not flexible enough to specify the number of attributes so the document lays out the way to do that.
Hi @drapergeek, i honestly can not remember what this was about.
I mean, as it reads, it was meant to provide a beginners perspective on missing documentation.
But i got it done, moved on, and forgot.
I'll close it for you.
I'm just starting out and feel I had to google a little bit too much to build a factory that has a simple has_many association.
Not only is the Getting started on the subject wrong but also many a link points there as an explanation.
By wrong i mean when i do as it says, my association will _not return objects, only the length (as it states)
To get an actual association I found this kind of code
FactoryGirl.define do
factory :listing_with_features, :parent => :listing do |listing|
features { build_list :feature, 3 }
end
end
which does exactly what one (one newbie that is) expects and wants.
I would offer to write this up, but i don't feel on solid ground with it, so i hope someone else will improve the docs.
thanks , Torsten
The text was updated successfully, but these errors were encountered: