Chatwoot/db/seeds.rb

31 lines
1.1 KiB
Ruby
Raw Normal View History

account = Account.create!([
2019-10-20 08:47:26 +00:00
{ name: 'Google' }
])
2019-10-20 08:47:26 +00:00
user = User.new(name: 'lary', email: 'larry@google.com', password: '123456', account_id: account.first.id)
user.skip_confirmation!
user.save!
channels = Channel.create!([
2019-10-20 08:47:26 +00:00
{ name: 'Facebook Messenger' }
])
inboxes = Inbox.create!([
2019-10-20 08:47:26 +00:00
{ channel: channels.first, account_id: 1, name: 'Google Car' },
{ channel: channels.first, account_id: 1, name: 'Project Loon' }
])
Contact.create!([
2019-10-20 08:47:26 +00:00
{ name: 'izuck@facebook.com', email: nil, phone_number: '99496030692', inbox_id: inboxes.first.id, account_id: 1 }
])
Conversation.create!([
2019-10-20 08:47:26 +00:00
{ account_id: 1, inbox_id: 1, status: :open, assignee_id: 1, sender_id: 1 }
])
InboxMember.create!([
2019-10-20 08:47:26 +00:00
{ user_id: 1, inbox_id: 1 }
])
Message.create!([
2019-10-20 08:47:26 +00:00
{ content: 'Hello', account_id: 1, inbox_id: 1, conversation_id: 1, message_type: :incoming }
])