gem 'faker' require 'faker' # Clean out what is there # Makes a bunch of different types of events per day at a random time during work hours (30.days.ago.to_date..90.days.from_now.to_date).each do |date| rand(5).times do start = date.beginning_of_day + 8.hours + (rand(32) * 15).minutes Appointment.create :creator => User.find(:first, :order => 'rand()'), :starts_at => start, :ends_at => start + (rand(16) * 15).minutes, :account_id => 1, :name => "Meet with #{Faker::Name.name}" end rand(3).times do event = %w(birthday vacation sick trial).rand AllDay.create :creator => User.find(:first, :order => rand()), :starts_at => date, :ends_at => date + rand(4).days, :account_id => 1, :name => "#{Faker::Name.name}'s #{event}" end rand(4).times do CourtDate.create :creator => User.find(:first, :order => rand()), :starts_at => date, :ends_at => start + ((3..5).to_a.rand * 15).minutes, :account_id => 1, :name => "Help #{Faker::Name.name} with FinDec" end rand(4).times do Task.create :creator => User.find(:first, :order => rand()), :starts_at => date, :account_id => 1, :name => "Help #{Faker::Name.name} with FinDec" end rand(4).times do start = date.beginning_of_day + 8.hours + (rand(32) * 15).minutes Deadline.create :creator => User.find(:first, :order => rand()), :starts_at => start, :account_id => 1, :name => "File docs for #{Faker::Name.name}" end end