anhetegua
817 Bytes
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/environment'
Environment.default.categories.destroy_all
def new_category(parent, name, color = nil)
category = Environment.default.categories.build(:name => name, :display_color => color, :parent_id => (parent ? parent.id: nil))
category.save!
category
end
tematicas = new_category(nil, 'Temáticas', 1)
new_category(tematicas, 'Finanças Solidárias')
new_category(tematicas, 'Marco Legal')
new_category(tematicas, 'Software Livre')
territorios = new_category(nil, 'Territórios', 2)
new_category(territorios, 'Bahia')
new_category(territorios, 'Distrito Federal')
new_category(territorios, 'Rio Grande do Sul')
cadeias = new_category(nil, 'Cadeias', 3)
new_category(cadeias, 'Algodão')
new_category(cadeias, 'Tecnologia de Informação')