私はこの設定を持っています:
factory :agency do |a|
a.agents_attributes { [FactoryGirl.attributes_for(:agent)] }
a.subdomain 'clear'
a.name 'ClearProperty'
end
factory :agent do |a|
agency
a.email '[email protected]'
a.password 'please'
end
代理店has_manyエージェントと代理店が存在する必要があります。この鶏卵を解決するには?私は工場(:代理店)をしたいが、これは工場(:代理店)に電話をかけ、別の代理店の建設を試みる。