/
contacts.yml
70 lines (66 loc) · 2.95 KB
/
contacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# == Schema Information
#
# Table name: contacts
#
# id :integer not null, primary key
# user_id :integer
# lead_id :integer
# assigned_to :integer
# reports_to :integer
# first_name :string(64) default(""), not null
# last_name :string(64) default(""), not null
# access :string(8) default("Public")
# title :string(64)
# department :string(64)
# source :string(32)
# email :string(64)
# alt_email :string(64)
# phone :string(32)
# mobile :string(32)
# fax :string(32)
# blog :string(128)
# linkedin :string(128)
# facebook :string(128)
# twitter :string(128)
# born_on :date
# 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 contacts..."
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) << ""
for i in (1 .. rand(20) + 100) do
%>
contact_<%= i %>:
id : <%= i %>
user_id : <%= rand(8) + 1 %>
assigned_to : <%= rand(8) + 1 %>
reports_to : <%= (rand(8) + 1) if i > 10 %>
first_name : <%= first_name = FFaker::Name.first_name %>
last_name : <%= last_name = FFaker::Name.last_name %>
access : Public
title : <%= title.sample %>
department :
source : <%= source.sample %>
email : <%= FFaker::Internet.free_email.sub(/^.+?@/, "#{first_name}#{last_name.first}@".downcase) %>
alt_email : <%= FFaker::Internet.free_email.sub(/^.+?@/, "#{first_name}#{rand(9999)}@".downcase) %>
phone : <%= FFaker::PhoneNumber.short_phone_number if rand(10) < 8 %>
mobile : <%= FFaker::PhoneNumber.short_phone_number if rand(10) < 6 %>
fax : <%= FFaker::PhoneNumber.short_phone_number if rand(10) < 4 %>
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 %>
skype : <%= %[#{(first_name + last_name.first).downcase}] if rand(10) < 8 %>
born_on : <%= Date.today - (rand(20) + 20).years - rand(200).days %>
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 %>