feat: Toggle to disallow users to send messages after a conversation is resolved (#3605)

This commit is contained in:
Aswin Dev P.S
2022-01-11 00:32:03 -08:00
committed by GitHub
parent a0884310f4
commit 7ee7062843
10 changed files with 91 additions and 22 deletions

View File

@@ -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