Added seeds.rb for an easy start.
This commit is contained in:
parent
50a45cfa7d
commit
1e49a44a92
2 changed files with 27 additions and 23 deletions
27
db/seeds.rb
Normal file
27
db/seeds.rb
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Create nessecary data to start with a fresh installation
|
||||
|
||||
# Create working group with full rights
|
||||
administrators = Workgroup.create(
|
||||
:name => "Administrators",
|
||||
:description => "System administrators.",
|
||||
:role_admin => true,
|
||||
:role_finance => true,
|
||||
:role_article_meta => true,
|
||||
:role_suppliers => true,
|
||||
:role_orders => true
|
||||
)
|
||||
|
||||
# Create admin user
|
||||
admin = User.create(
|
||||
:nick => "admin",
|
||||
:first_name => "Anton",
|
||||
:last_name => "Administrator",
|
||||
:email => "admin@foo.test",
|
||||
:password => "secret"
|
||||
)
|
||||
|
||||
# Admin joins the admin group
|
||||
Membership.create(:group => administrators, :user => admin)
|
||||
|
||||
# First entry for article categories
|
||||
ArticleCategory.create(:name => "Other", :description => "The other stuff fits here..")
|
||||
Loading…
Add table
Add a link
Reference in a new issue