0
我需要爲我的應用程序創建一些複雜的模型,我需要重新使用模型的一個字段。我想這樣做FactoryGirl模型中的複雜組合
FactoryGirl.define do
factory :invoice do
sequence(:name) { |n| "Testowa #{n}" }
full_amount 10_000
pay_date DateTime.now + 7.days
association :clienr
company client.company
end
end
但後來我得到錯誤undefined method
company'for#`。我非常需要測試我的應用程序,而且我無法在文檔中找到任何內容。