# == Schema Information # # Table name: leads # # id :integer not null, primary key # user_id :integer # campaign_id :integer # assigned_to :integer # first_name :string(64) default(""), not null # last_name :string(64) default(""), not null # access :string(8) default("Public") # title :string(64) # company :string(64) # source :string(32) # status :string(32) # referred_by :string(64) # email :string(64) # alt_email :string(64) # phone :string(32) # mobile :string(32) # blog :string(128) # linkedin :string(128) # facebook :string(128) # twitter :string(128) # rating :integer default(0), not null # do_not_call :boolean default(FALSE), not null # deleted_at :datetime # created_at :datetime # updated_at :datetime # background_info :string(255) # skype :string(128) # <% require "ffaker" puts "Loading leads..." FFaker::PhoneNumber::Formats = ["(###)###-####"] title = [ "", "Director", "Sales Manager", "Executive Assistant", "Marketing Manager", "Project Manager", "Product Manager", "Engineer" ] source = %w(campaign cold_call conference online referral self web word_of_mouth other) << "" status = %w(new contacted converted rejected) << "" for i in (1 .. rand(20) + 100) do %> lead<%= i %>: id : <%= i %> user_id : <%= rand(8) + 1 %> campaign_id : <%= rand(5) + 1 %> assigned_to : <%= rand(8) + 1 %> first_name : <%= first_name = FFaker::Name.first_name %> last_name : <%= last_name = FFaker::Name.last_name %> access : Public company : <%= FFaker::Company.name %> title : <%= title.sample %> source : <%= source.sample %> status : <%= status.sample %> rating : <%= rand(5) %> referred_by : <%= FFaker::Name.first_name + " " + FFaker::Name.last_name if rand(10) < 5 %> blog : <%= %[http://#{(first_name + last_name.first).downcase}.blogger.com] if rand(10) < 8 %> linkedin : <%= %[http://www.linkedin.com/#{(first_name + last_name.first).downcase}] if rand(10) < 8 %> facebook : <%= %[http://www.facebook.com/#{(first_name + last_name.first).downcase}] if rand(10) < 8 %> twitter : <%= %[http://www.twitter.com/#{(first_name + last_name.first).downcase}] if rand(10) < 8 %> email : <%= FFaker::Internet.free_email.sub(/^.+?@/, "#{first_name}#{last_name.first}@".downcase) %> alt_email : <%= FFaker::Internet.free_email.sub(/^.+?@/, "#{first_name}#{rand(9999)}@".downcase) if rand(10) < 3 %> phone : <%= FFaker::PhoneNumber.short_phone_number if rand(10) < 5 %> mobile : <%= FFaker::PhoneNumber.short_phone_number if rand(10) < 3 %> do_not_call : false created_at : <%= created_at = (rand(60) + 2).days.ago + rand(600).minutes; created_at.to_s(:db) %> updated_at : <%= (created_at + rand(36_000).seconds).to_s(:db) %> background_info : <%= FFaker::Lorem.paragraph[0,255] %> <% end %>