2011-11-22 14 views

cevap

30

Ödeme this answer - kullanmak Array#sample: ` FactoryGirl.define yapmak fabrika: foo yapmak çubuğu {(1..99) .to_a

FactoryGirl.define do 
    factory :user do 
    name "Foo Bar" 
    foo { [:a, :list, :of, :values].sample } 
    end 
end 
+0

Kolay tamsayılar için kullanılacak Örnek (3)} sonu sonu ' –

İlgili konular