I have no idea if I went about it the right way, but I wrote a Rake
task for faker. It works great for me! Just thought I'd share.
namespace :db do
namespace :development do
desc "Create records in the development database."
task :fake_data => :environment do
require 'faker'
100.times do
c = Client.new(
:first_name => Faker::Name.first_name,
:middle_initial => ("A".."Z").to_a.rand,
:last_name => Faker::Name.last_name,
:ss_number => 99999999 + rand(999999999 - 99999999),
:date_of_birth => Time.now - (rand(12000)).days)
end
end
end
end
Chris
http://26Webs.com/