2014-04-08 13:11:06 +02:00
|
|
|
# Create nessecary data to start with a fresh installation
|
|
|
|
|
|
|
|
# Create working group with full rights
|
2020-10-10 19:40:37 +02:00
|
|
|
administrators = Workgroup.create!(
|
2023-05-12 13:01:12 +02:00
|
|
|
name: 'Administrators',
|
|
|
|
description: 'System administrators.',
|
|
|
|
role_admin: true,
|
|
|
|
role_finance: true,
|
|
|
|
role_article_meta: true,
|
|
|
|
role_pickups: true,
|
|
|
|
role_suppliers: true,
|
|
|
|
role_orders: true
|
2014-04-08 13:11:06 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Create admin user
|
2020-10-10 19:40:37 +02:00
|
|
|
User.create!(
|
2023-05-12 13:01:12 +02:00
|
|
|
nick: 'admin',
|
|
|
|
first_name: 'Anton',
|
|
|
|
last_name: 'Administrator',
|
|
|
|
email: 'admin@foo.test',
|
|
|
|
password: 'secret',
|
|
|
|
groups: [administrators]
|
2014-04-08 13:11:06 +02:00
|
|
|
)
|
|
|
|
|
2017-03-04 14:15:18 +01:00
|
|
|
# First entry for financial transaction types
|
2023-05-12 13:01:12 +02:00
|
|
|
financial_transaction_class = FinancialTransactionClass.create!(name: 'Other')
|
|
|
|
FinancialTransactionType.create!(name: 'Foodcoop', financial_transaction_class_id: financial_transaction_class.id)
|
2017-03-04 14:15:18 +01:00
|
|
|
|
2014-04-08 13:11:06 +02:00
|
|
|
# First entry for article categories
|
2023-05-12 13:01:12 +02:00
|
|
|
SupplierCategory.create!(name: 'Other', financial_transaction_class_id: financial_transaction_class.id)
|
|
|
|
ArticleCategory.create!(name: 'Other', description: 'other, misc, unknown')
|