Chore: Web widget Inbox Tech Debts (#738)
* Chore: Webwidget Inbox Tech Debts * Additional customization options creating Web Widget * Changes to edit Page for Web Widget * Remove the WebWidget API end points * Minor chores Address: #680, #502 Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
# Table name: channel_twitter_profiles
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# name :string
|
||||
# twitter_access_token :string not null
|
||||
# twitter_access_token_secret :string not null
|
||||
# created_at :datetime not null
|
||||
@@ -21,17 +20,12 @@ class Channel::TwitterProfile < ApplicationRecord
|
||||
|
||||
validates :account_id, presence: true
|
||||
validates :profile_id, uniqueness: { scope: :account_id }
|
||||
has_one_attached :avatar
|
||||
belongs_to :account
|
||||
|
||||
has_one :inbox, as: :channel, dependent: :destroy
|
||||
|
||||
before_destroy :unsubscribe
|
||||
|
||||
def name
|
||||
'Twitter'
|
||||
end
|
||||
|
||||
def create_contact_inbox(profile_id, name, additional_attributes)
|
||||
ActiveRecord::Base.transaction do
|
||||
contact = inbox.account.contacts.create!(additional_attributes: additional_attributes, name: name)
|
||||
|
||||
Reference in New Issue
Block a user