feat: Toggle to disallow users to send messages after a conversation is resolved (#3605)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class AddAllowMessagesAfterResolvedToInbox < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :inboxes, :allow_messages_after_resolved, :boolean, default: true
|
||||
|
||||
update_csat_enabled_inboxes
|
||||
end
|
||||
|
||||
def update_csat_enabled_inboxes
|
||||
::Inbox.where(channel_type: 'Channel::WebWidget', csat_survey_enabled: true).find_in_batches do |inboxes_batch|
|
||||
inboxes_batch.each do |inbox|
|
||||
inbox.allow_messages_after_resolved = false
|
||||
inbox.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -461,6 +461,7 @@ ActiveRecord::Schema.define(version: 2021_12_21_125545) do
|
||||
t.string "timezone", default: "UTC"
|
||||
t.boolean "enable_email_collect", default: true
|
||||
t.boolean "csat_survey_enabled", default: false
|
||||
t.boolean 'allow_messages_after_resolved', default: true
|
||||
t.index ["account_id"], name: "index_inboxes_on_account_id"
|
||||
end
|
||||
|
||||
@@ -829,4 +830,4 @@ ActiveRecord::Schema.define(version: 2021_12_21_125545) do
|
||||
"NEW.display_id := nextval('camp_dpid_seq_' || NEW.account_id);"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user