Skip to content

Commit

Permalink
add seeds file in case we ever want to adjust the csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
kariabancroft committed Aug 14, 2017
1 parent 6ef0da2 commit 6aedf8f
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions seeds.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
require 'csv'
require 'faker'


# Students do not need to modify this file
# This is the file created by instructors to create all CSV files

# orders
# id = 1
# CSV.open("support/orders.csv", "w") do |csv|
# 100.times do
# foods = ""
# rand(1..4).times do
# foods += Faker::Food.ingredient + ":" + Faker::Commerce.price.to_s + ";"
# end
#
# foods = foods.chomp(';')
# csv << [id, foods]
# id += 1
# end
# end

# customers
# id = 1
# CSV.open("support/customers.csv", "w") do |csv|
# 35.times do
# csv << [id, Faker::Internet.email,
# Faker::Address.street_address, Faker::Address.city, Faker::Address.state_abbr, Faker::Address.zip_code]
# id += 1
# end
# end

# online orders
# id = 1
# statuses = %i(pending paid processing shipped complete)
# CSV.open("support/online_orders.csv", "w") do |csv|
# 100.times do
# foods = ""
# rand(1..4).times do
# foods += Faker::Food.ingredient + ":" + Faker::Commerce.price.to_s + ";"
# end
#
# foods = foods.chomp(';')
# # id, string of foods, customer ID, random status
# csv << [id, foods, rand(1..35), statuses.sample]
# id += 1
# end
# end

0 comments on commit 6aedf8f

Please sign in to comment.