From 1847779319ee745698c7020a158bd8a253d4ea55 Mon Sep 17 00:00:00 2001 From: Alexey Nayden Date: Thu, 10 Mar 2011 16:45:19 +0300 Subject: [PATCH] Seed task for projects and platforms --- db/seeds.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/db/seeds.rb b/db/seeds.rb index 446698d82..7a96639d9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -15,3 +15,17 @@ TEST_USERS.each do |tuser| User.create! :name => name, :email => email, :password => pass, :password_confirmation => pass puts "Created user #{name} (#{email}) and password #{pass}" end + + +TEST_PLATFORMS = %w(cooker Mandriva2010.10 Mandriva2011.4) +TEST_PROJECTS = %w(gcc glibc mysql-dev ruby ruby1.9 mc mesa avrdude vim gvim openssh-server openssh nethack binutils build-essentials rpm rpmtools ffmpeg mkvtoolnix libogg mpg123 openbox openoffice.org) + + +TEST_PLATFORMS.each do |platform| + p = Platform.find_or_create_by_name(platform) + TEST_PROJECTS.each do |project| + pr = Project.find_or_initialize_by_platform_id_and_name(p.id, project) + puts "#{project} added to #{platform}" if pr.new_record? + pr.save! + end +end