Feature: Create conversations from Tweets (#470)
* Feature: Add tweets to conversations
This commit is contained in:
@@ -28,9 +28,9 @@ class Channel::TwitterProfile < ApplicationRecord
|
||||
'Twitter'
|
||||
end
|
||||
|
||||
def create_contact_inbox(profile_id, name)
|
||||
def create_contact_inbox(profile_id, name, additional_attributes)
|
||||
ActiveRecord::Base.transaction do
|
||||
contact = inbox.account.contacts.create!(name: name)
|
||||
contact = inbox.account.contacts.create!(additional_attributes: additional_attributes, name: name)
|
||||
::ContactInbox.create!(
|
||||
contact_id: contact.id,
|
||||
inbox_id: inbox.id,
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
#
|
||||
# Table name: contacts
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# email :string
|
||||
# name :string
|
||||
# phone_number :string
|
||||
# pubsub_token :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :integer not null
|
||||
# id :integer not null, primary key
|
||||
# additional_attributes :jsonb
|
||||
# email :string
|
||||
# name :string
|
||||
# phone_number :string
|
||||
# pubsub_token :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :integer not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
||||
@@ -12,14 +12,21 @@
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :integer not null
|
||||
# contact_id :bigint
|
||||
# conversation_id :integer not null
|
||||
# fb_id :string
|
||||
# inbox_id :integer not null
|
||||
# source_id :string
|
||||
# user_id :integer
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_messages_on_contact_id (contact_id)
|
||||
# index_messages_on_conversation_id (conversation_id)
|
||||
# index_messages_on_source_id (source_id)
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
# fk_rails_... (contact_id => contacts.id)
|
||||
#
|
||||
|
||||
class Message < ApplicationRecord
|
||||
|
||||
Reference in New Issue
Block a user