17
db/migrate/20210315101919_enable_email_channel.rb
Normal file
17
db/migrate/20210315101919_enable_email_channel.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class EnableEmailChannel < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
current_config = InstallationConfig.where(name: 'ACCOUNT_LEVEL_FEATURE_DEFAULTS').last
|
||||
current_config.value.each { |v| v['enabled'] = true if %w[inbound_emails channel_email].include?(v['name']) }
|
||||
current_config.save!
|
||||
|
||||
ConfigLoader.new.process
|
||||
|
||||
Account.find_in_batches do |account_batch|
|
||||
account_batch.each do |account|
|
||||
account.enable_features('inbound_emails')
|
||||
account.enable_features('channel_email')
|
||||
account.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_03_03_192243) do
|
||||
ActiveRecord::Schema.define(version: 2021_03_15_101919) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
|
||||
Reference in New Issue
Block a user