Sha256: 8d2ba45b321beffdef7d2d79d9f17a5531d6d88d35f0639cc6e27908d27e6a54

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

minimum_count = 10

if Redshop::Category.count < minimum_count
  minimum_count.times do
    Redshop::Category.create!(name: Faker::Lorem.word)#, preview: Faker::Avatar.image, background: Faker::Placeholdit.image)
  end
end

if Redshop::Product.count < minimum_count
  minimum_count.times do
    Redshop::Product.create!(name: Faker::Lorem.word, desc: Faker::Lorem.sentence, price: rand(1..100), category: Redshop::Category.all.sample,
                    rating: rand(1.1..4.9), image: Faker::Avatar.image)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redshop-0.0.1 db/seeds.rb