Commit 5cf174239bb9af97c4eda0bacdcd3569854358d1
1 parent
1d28968e
Exists in
master
and in
22 other branches
ActionItem93: still massaging sample data
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1045 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
14 additions
and
1 deletions
Show diff stats
script/anhetegua
1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
2 | require File.dirname(__FILE__) + '/../config/environment' | 2 | require File.dirname(__FILE__) + '/../config/environment' |
3 | 3 | ||
4 | -Environment.default.categories.destroy_all | 4 | +Environment.destroy_all |
5 | User.destroy_all | 5 | User.destroy_all |
6 | Profile.destroy_all | 6 | Profile.destroy_all |
7 | + | ||
7 | Role.destroy_all | 8 | Role.destroy_all |
8 | RoleAssignment.destroy_all | 9 | RoleAssignment.destroy_all |
9 | Category.destroy_all | 10 | Category.destroy_all |
10 | Product.destroy_all | 11 | Product.destroy_all |
12 | +Article.destroy_all | ||
11 | 13 | ||
12 | def new_category(parent, name, color = nil) | 14 | def new_category(parent, name, color = nil) |
13 | category = Environment.default.categories.build(:name => name, :display_color => color, :parent_id => (parent ? parent.id: nil)) | 15 | category = Environment.default.categories.build(:name => name, :display_color => color, :parent_id => (parent ? parent.id: nil)) |
@@ -34,6 +36,8 @@ def new_member(org, person) | @@ -34,6 +36,8 @@ def new_member(org, person) | ||
34 | org.affiliate() | 36 | org.affiliate() |
35 | end | 37 | end |
36 | 38 | ||
39 | +Environment.create!(:name => 'Economia Solidária', :is_default => true) | ||
40 | + | ||
37 | tematicas = new_category(nil, 'Temáticas', 1) | 41 | tematicas = new_category(nil, 'Temáticas', 1) |
38 | new_category(tematicas, 'Finanças Solidárias') | 42 | new_category(tematicas, 'Finanças Solidárias') |
39 | new_category(tematicas, 'Marco Legal') | 43 | new_category(tematicas, 'Marco Legal') |
@@ -117,3 +121,12 @@ colivre.products.build(:name => 'desenvolvimento de software livre', :product_ca | @@ -117,3 +121,12 @@ colivre.products.build(:name => 'desenvolvimento de software livre', :product_ca | ||
117 | colivre.products.build(:name => 'capacitação em software livre', :product_category => capacitacao).save! | 121 | colivre.products.build(:name => 'capacitação em software livre', :product_category => capacitacao).save! |
118 | colivre.products.build(:name => 'arte digital', :product_category => arte_digital).save! | 122 | colivre.products.build(:name => 'arte digital', :product_category => arte_digital).save! |
119 | colivre.products.build(:name => 'instalação e manutenção de servidores', :product_category => admin_de_sistemas).save! | 123 | colivre.products.build(:name => 'instalação e manutenção de servidores', :product_category => admin_de_sistemas).save! |
124 | + | ||
125 | +colivre_hp = colivre.articles.build(:name => 'Colivre - Cooperativa de Tecnologias Livres', :body => '<p>A Colivre, Cooperativa de Tecnologias Livres, é uma organização baiana que presta serviços de instalação de redes, segurança, capacitação, migração e desenvolvimento de novas soluções, trabalhando exclusivamente com Tecnologias Livres. Para tanto, contamos com uma equipe formada por desenvolvedores/as de software, webdesigners e gestoras/es com vasta experiência na área.</p>', :tag_list => 'software livre, colivre, cooperativa' ) | ||
126 | +colivre_hp.save! | ||
127 | +colivre.home_page = colivre_hp | ||
128 | +colivre.save! | ||
129 | + | ||
130 | +empa_hp = colivre.articles.build(:name => 'Empreendimento A - um empreendimento genérico', :body => '<p>Esse é um empreendimento cadastrado como exemplo no sitema</p>', :tag_list => 'cooperativa, teste') | ||
131 | +empa.home_page = empa_hp | ||
132 | +empa.save! |