forked from chatwoot/chatwoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseeds.rb
30 lines (25 loc) · 825 Bytes
/
seeds.rb
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
account = Account.create!([
{name: "Google"}
])
user = User.new({name:"lary", email: "[email protected]", password: "123456", account_id: account.first.id})
user.skip_confirmation!
user.save!
channels = Channel.create!([
{name: "Facebook Messenger"}
])
inboxes = Inbox.create!([
{channel: channels.first, account_id: 1, name: "Google Car"},
{channel: channels.first, account_id: 1, name: "Project Loon"}
])
Contact.create!([
{name: "[email protected]", email: nil, phone_number: "99496030692", inbox_id: inboxes.first.id, account_id: 1}
])
Conversation.create!([
{account_id: 1, inbox_id: 1, status: :open, assignee_id: 1, sender_id: 1}
])
InboxMember.create!([
{user_id: 1, inbox_id: 1}
])
Message.create!([
{content: "Hello", account_id: 1, inbox_id: 1, conversation_id: 1, message_type: :incoming}
])