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:
12
db/seeds.rb
12
db/seeds.rb
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user