diff --git a/lib/tasks/create_categories.rake b/lib/tasks/create_categories.rake index 4bf9089..f49ccd3 100644 --- a/lib/tasks/create_categories.rake +++ b/lib/tasks/create_categories.rake @@ -2,22 +2,22 @@ namespace :software do desc "Create software categories" task :create_categories => :environment do Environment.all.each do |env| - if env.plugin_enabled?("MpogSoftwarePlugin") - software = Category.create!(:name => _("Software"), :environment => env) - Category.create!(:name => _("Agriculture, Fisheries and Extraction"), :environment => env, :parent => software) - Category.create!(:name => _("Science, Information and Communication"), :environment => env, :parent => software) - Category.create!(:name => _("Economy and Finances"), :environment => env, :parent => software) - Category.create!(:name => _("Public Administration"), :environment => env, :parent => software) - Category.create!(:name => _("Habitation, Sanitation and Urbanism"), :environment => env, :parent => software) - Category.create!(:name => _("Individual, Family and Society"), :environment => env, :parent => software) - Category.create!(:name => _("Health"), :environment => env, :parent => software) - Category.create!(:name => _("Social Welfare and Development"), :environment => env, :parent => software) - Category.create!(:name => _("Defense and Security"), :environment => env, :parent => software) - Category.create!(:name => _("Education"), :environment => env, :parent => software) - Category.create!(:name => _("Government and Politics"), :environment => env, :parent => software) - Category.create!(:name => _("Justice and Legislation"), :environment => env, :parent => software) - Category.create!(:name => _("International Relationships"), :environment => env, :parent => software) - Category.create!(:name => _("Transportation and Traffic"), :environment => env, :parent => software) + if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("MpogSoftwarePlugin") + software = Category.create(:name => _("Software"), :environment => env) + Category.create(:name => _("Agriculture, Fisheries and Extraction"), :environment => env, :parent => software) + Category.create(:name => _("Science, Information and Communication"), :environment => env, :parent => software) + Category.create(:name => _("Economy and Finances"), :environment => env, :parent => software) + Category.create(:name => _("Public Administration"), :environment => env, :parent => software) + Category.create(:name => _("Habitation, Sanitation and Urbanism"), :environment => env, :parent => software) + Category.create(:name => _("Individual, Family and Society"), :environment => env, :parent => software) + Category.create(:name => _("Health"), :environment => env, :parent => software) + Category.create(:name => _("Social Welfare and Development"), :environment => env, :parent => software) + Category.create(:name => _("Defense and Security"), :environment => env, :parent => software) + Category.create(:name => _("Education"), :environment => env, :parent => software) + Category.create(:name => _("Government and Politics"), :environment => env, :parent => software) + Category.create(:name => _("Justice and Legislation"), :environment => env, :parent => software) + Category.create(:name => _("International Relationships"), :environment => env, :parent => software) + Category.create(:name => _("Transportation and Traffic"), :environment => env, :parent => software) end end end diff --git a/lib/tasks/main_data.rake b/lib/tasks/main_data.rake index 1466d55..71a1dfd 100644 --- a/lib/tasks/main_data.rake +++ b/lib/tasks/main_data.rake @@ -12,6 +12,7 @@ namespace :main_data do task :all => :environment do Rake::Task["main_data:destroy"].invoke Rake::Task["templates:destroy"].invoke + Rake::Task["software:create_categories"].invoke Rake::Task["main_data:populate"].invoke end @@ -43,7 +44,7 @@ namespace :main_data do generate_fixed_blocks(community) - generate_article(community, Blog, {name: "Notícias", slug: "noticias", published: true, accept_comments: true, notify_comments: true, license_id: 1, body: "", accept_comments: false, posts_per_page: 5}) + generate_article(community, Blog, {name: "Notícias", slug: "noticias", published: true, accept_comments: true, notify_comments: true, license_id: 1, body: "", accept_comments: false, posts_per_page: 5}, true) generate_article(community, TinyMceArticle, {name: "Sobre o Portal", slug: "sobre-o-portal", published: true, accept_comments: false, notify_comments: true, license_id: 1, body: "", accept_comments: false}) generate_article(community, TinyMceArticle, {name: "Publique seu software", slug: "publique-seu-software", published: true, accept_comments: false, notify_comments: true, license_id: 1, body: "", accept_comments: false}) generate_article(community, TinyMceArticle, {name: "Inicie um projeto", slug: "inicie-um-projeto", published: true, accept_comments: false, notify_comments: true, license_id: 1, body: "", accept_comments: false}) -- libgit2 0.21.2