Passing single attributes to associated factories
- by lambdabutz
I'm looking for a way to pass fields into the factories of associated models without having to explicitly call the factory itself.
For example, lets say I have some factories like so:
Factory.define :person do |person|
person.name "Default Bob"
person.sex "M"
person.house {|p| p.association(:house)}
end
Factory.define :house do |house|
…