Chatwoot/db/seeds.rb
Sojan Jose ba8f055802
Change sender_id to contact_id in conversations (#167)
* change sender_id to contact_id in conversations

* Fix failing tests

* Fix seeds

* fix specs

* Fix issues in facebook messenger
2019-10-21 00:40:18 +05:30

14 lines
No EOL
795 B
Ruby

account = Account.create!(name: 'Acme Inc')
user = User.new(name: 'John', email: 'john@acme.inc', password: '123456', account: account, role: :administrator)
user.skip_confirmation!
user.save!
web_widget = Channel::WebWidget.create!(account: account, website_name: 'Acme', website_url: 'https://acme.inc')
inbox = Inbox.create!(channel: web_widget, account: account, name: 'Acme Support')
InboxMember.create!(user: user, inbox: inbox)
contact = Contact.create!(name: 'jane', email: 'jane@example.com', phone_number: '0000', inbox: inbox, account: account)
conversation = Conversation.create!(account: account, inbox: inbox, status: :open, assignee: user, contact: contact)
Message.create!(content: 'Hello', account: account, inbox: inbox, conversation: conversation, message_type: :incoming)