Sha256: 96c6405fb99f330606518c2e6cfc9391bbd25ca0f95e3e2fe72d380611be8d7b
Contents?: true
Size: 518 Bytes
Versions: 19
Compression:
Stored size: 518 Bytes
Contents
Factory.sequence(:product_sequence) {|n| "Product ##{n} - #{rand(9999)}"} Factory.define :product do |f| f.name { Factory.next(:product_sequence) } f.description { Faker::Lorem.paragraphs(rand(5)+1).join("\n") } # associations: f.tax_category {|r| TaxCategory.find(:first) || r.association(:tax_category)} f.shipping_category {|r| ShippingCategory.find(:first) || r.association(:shipping_category)} f.price 19.99 f.cost_price 17.00 f.sku "ABC" f.available_on { 1.year.ago } f.deleted_at nil end
Version data entries
19 entries across 19 versions & 6 rubygems