feat: Ability to seed Demo Accounts (#5352)

Introduces the ability to seed sample data into accounts in development and staging.

fixes: #3429
This commit is contained in:
Sojan Jose
2022-09-01 00:31:43 +05:30
committed by GitHub
parent ebea5428bc
commit c8d01a84ce
13 changed files with 593 additions and 76 deletions

View File

@@ -11,6 +11,12 @@ end
## Seeds for Local Development
unless Rails.env.production?
# Enables creating additional accounts from dashboard
installation_config = InstallationConfig.find_by(name: 'CREATE_NEW_ACCOUNT_FROM_DASHBOARD')
installation_config.value = true
installation_config.save!
GlobalConfig.clear_cache
account = Account.create!(
name: 'Acme Inc'
)
@@ -35,12 +41,6 @@ unless Rails.env.production?
role: :administrator
)
# Enables creating additional accounts from dashboard
installation_config = InstallationConfig.find_by(name: 'CREATE_NEW_ACCOUNT_FROM_DASHBOARD')
installation_config.value = true
installation_config.save!
GlobalConfig.clear_cache
web_widget = Channel::WebWidget.create!(account: account, website_url: 'https://acme.inc')
inbox = Inbox.create!(channel: web_widget, account: account, name: 'Acme Support')