Generating demo data on Connec!™
Connec!™ offers three different way to generate demo data for a given organization, via rake tasks or the rails console.
Not for production use
Please note that the following instructions may have an adverse impact if run on an existing organisation containing production data. Some guarding exist in the rake tasks to prevent that but it's not 100% bullet proof.
As a rule of thumb we recommend running these tasks in test environments only
1 - Generating demo data
This task can be used to generate a reasonable number of records for a given organisation. It is essentially used to prepare demo accounts.
Login to a Connec!™ server under the application directory and run the following task:
# You may need to source the jruby environment # source /etc/profile.d/jruby.sh # This task will generate demo data for organization 'org-fbba' rake connec:generate_data:demo['org-fbba']
2 - Generating load testing data
This tasks can be used to load an account with 10,000+ records. It is essentially used to prepare load testing accounts.
# You may need to source the jruby environment # source /etc/profile.d/jruby.sh # This task will generate load testing data for organization 'org-fbba' rake connec:generate_data:load['org-fbba']
3 - Generating a custom dataset
The generated dataset can be fully customised. To do so login to Connec!™ through the rails console and run the following:
# You may need to source the jruby environment # source /etc/profile.d/jruby.sh # Access the rails console rails c <your_environment>
# Set organization id org_id = 'org-fbba' # Prepare dataset options # Displayed values are the default ones opts = { channel_id: org_id # which organization to load notify: false, # also create objects in connected apps? country: 'US', # company country currency: 'USD', # company currency nb_opportunities: 50 # total number of opportunities to create nb_invoices: 2, # number of invoices per month per customer/supplier to create nb_credit_notes: 2, # number of credit notes per month per customer/supplier to create months_history: 0, # 1 year + x months of history skip_taxes: false, # skip creation of taxes skip_accounts: false, # skip creation of the chart of accounts skip_contacts: false, # skip creation of contacts } # Run the generator generator = DemoData::Generator.new(opts) generator.generate_all
It is possible to generate more transactions with a different currency in order to test Forex Adjustments
# Set organization id org_id = 'org-fbba' # Prepare dataset options # Displayed values are the default ones opts = { channel_id: org_id # which organization to load country: 'AU', # company country currency: 'AUD', # company currency nb_invoices: 2, # number of invoices per month per customer/supplier to create nb_credit_notes: 2, # number of credit notes per month per customer/supplier to create months_history: 0, # 1 year + x months of history } # Run the generator generator = DemoData::Generator.new(opts) generator.generate_transactions