#---
# Excerpted from "Rails Recipes"
# We make no guarantees that this code is fit for any purpose. 
# Visit http://www.pragmaticprogrammer.com/titles/fr_rr for more book information.
#---
require 'rubygems' 
require 'active_record' 
 
ActiveRecord::Base.establish_connection(
  :adapter  => "mysql", 
  :host     => "localhost", 
  :username => "nightlybatch", 
  :password => "secret", 
  :database => "web_orders"
)
   

class Order < ActiveRecord::Base
end

100.times { 
  Order.create(:product_id => rand(10000), :customer_id => rand(1000), :quantity => rand(4))
}
   