Permalink
Browse files

cleanup euro seeds

  • Loading branch information...
1 parent bea5531 commit aeb69502f35c066faee258067774d9a758e45b21 @geraldb geraldb committed Jul 8, 2012
View
@@ -11,7 +11,10 @@
# or http://de.wikipedia.org/wiki/Fu%C3%9Fball-Europameisterschaft_2012
-euro = Event.create!( :key => 'euro', :title => 'Euro 2012', :team3 => false, :start_at => Time.cet( '2012-06-07 17:00' ))
+euro = Event.create!( :key => 'euro',
+ :title => 'Euro 2012',
+ :team3 => false,
+ :start_at => Time.cet( '2012-06-07 17:00' ))
pol = Team.find_by_key!( 'pol' )
gre = Team.find_by_key!( 'gre' )
View
@@ -3,26 +3,31 @@
puts "*** loading seed data in seeds/euro/teams.rb"
-Team.create!( :key => 'pol', :title => 'Polen', :tag => 'POL', :img => 'euro/poland2.png' )
-Team.create!( :key => 'gre', :title => 'Griechenland', :tag => 'GRE', :img => 'euro/greece2.png' )
-Team.create!( :key => 'rus', :title => 'Russland', :tag => 'RUS', :img => 'euro/russia2.png' )
-Team.create!( :key => 'cze', :title => 'Tschechien', :tag => 'CZE', :img => 'euro/czech_republic2.png' )
-
-Team.create!( :key => 'ned', :title => 'Niederlande', :tag => 'NED', :img => 'euro/netherlands2.png' )
-Team.create!( :key => 'den', :title => 'Dänemark', :tag => 'DEN', :img => 'euro/denmark2.png' )
-Team.create!( :key => 'ger', :title => 'Deutschland', :tag => 'GER', :img => 'euro/germany2.png' )
-Team.create!( :key => 'por', :title => 'Portugal', :tag => 'POR', :img => 'euro/portugal2.png' )
-
-Team.create!( :key => 'esp', :title => 'Spanien', :tag => 'ESP', :img => 'euro/spain2.png' )
-Team.create!( :key => 'ita', :title => 'Italien', :tag => 'ITA', :img => 'euro/italy2.png' )
-Team.create!( :key => 'irl', :title => 'Irland', :tag => 'IRL', :img => 'euro/ireland2.png' )
-Team.create!( :key => 'cro', :title => 'Kroatien', :tag => 'CRO', :img => 'euro/croatia2.png' )
-
-Team.create!( :key => 'ukr', :title => 'Ukraine', :tag => 'UKR', :img => 'euro/ukraine2.png' )
-Team.create!( :key => 'swe', :title => 'Schweden', :tag => 'SWE', :img => 'euro/sweden2.png' )
-Team.create!( :key => 'fra', :title => 'Frankreich', :tag => 'FRA', :img => 'euro/france2.png' )
-Team.create!( :key => 'eng', :title => 'England', :tag => 'ENG', :img => 'euroa/england2.png' )
-
+teams = [
+ [ 'pol', 'Polen', 'POL', 'euro/poland2.png' ],
+ [ 'gre', 'Griechenland', 'GRE', 'euro/greece2.png' ],
+ [ 'rus', 'Russland', 'RUS', 'euro/russia2.png' ],
+ [ 'cze', 'Tschechien', 'CZE', 'euro/czech_republic2.png' ],
+ [ 'ned', 'Niederlande', 'NED', 'euro/netherlands2.png' ],
+ [ 'den', 'Dänemark', 'DEN', 'euro/denmark2.png' ],
+ [ 'ger', 'Deutschland', 'GER', 'euro/germany2.png' ],
+ [ 'por', 'Portugal', 'POR', 'euro/portugal2.png' ],
+ [ 'esp', 'Spanien', 'ESP', 'euro/spain2.png' ],
+ [ 'ita', 'Italien', 'ITA', 'euro/italy2.png' ],
+ [ 'irl', 'Irland', 'IRL', 'euro/ireland2.png' ],
+ [ 'cro', 'Kroatien', 'CRO', 'euro/croatia2.png' ],
+ [ 'ukr', 'Ukraine', 'UKR', 'euro/ukraine2.png' ],
+ [ 'swe', 'Schweden', 'SWE', 'euro/sweden2.png' ],
+ [ 'fra', 'Frankreich', 'FRA', 'euro/france2.png' ],
+ [ 'eng', 'England', 'ENG', 'euro/england2.png' ],
+ [ 'fro', 'Färöer', 'FRO', 'euro/faroer2.png' ],
+ [ 'kaz', 'Kasachstan', 'KAZ', 'euro/kaz2.png' ],
+ [ 'aut', 'Österreich', 'AUT', 'euro/austria2.png' ]
+]
+
+
+
+Team.create_from_ary!( teams )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
View
@@ -1,79 +0,0 @@
-# encoding: utf-8
-
-puts "*** loading seed data in seeds/nhl.rb"
-
-######################################
-## NHL 2012
-
-nhl = Event.create!( :title => ' National Hockey League 2012', :key => 'nhl', :start_at => '2011-10-10' )
-
-newjersey = Team.create!( :title => 'New Jersey Devils (East/Atlantic)', :key => 'newjersey', :img => 'devils.png' )
-nyislanders = Team.create!( :title => 'New York Islanders (East/Atlantic)', :key => 'nyislanders', :img => 'islanders.png' )
-nyrangers = Team.create!( :title => 'New York Rangers (East/Atlantic)', :key => 'nyrangers', :img => 'rangers.png' )
-philadelphia = Team.create!( :title => 'Philadelphia Flyers (East/Atlantic)', :key => 'philadelphia', :img => 'flyers.png' )
-pittsburgh = Team.create!( :title => 'Pittsburgh Penguins (East/Atlantic)', :key => 'pittsburgh', :img => 'penguins.png' )
-
-boston = Team.create!( :title => 'Boston Bruis (East/Northeast)', :key => 'boston', :img => 'bruins.png' )
-buffalo = Team.create!( :title => 'Buffalo Sabres (East/Northeast)', :key => 'buffalo', :img => 'sabres.png' )
-montreal = Team.create!( :title => 'Montreal Canadiens (East/Northeast)', :key => 'montreal', :img => 'canadiens.png' )
-ottawa = Team.create!( :title => 'Ottawa Senators (East/Northeast)', :key => 'ottawa', :img => 'senators.png' )
-toronto = Team.create!( :title => 'Toronto Maple Leafs (East/Northeast)', :key => 'toronto', :img => 'mapleleafs.png' )
-
-carolina = Team.create!( :title => 'Carolina Hurricanes (East/Southeast)', :key => 'carolina', :img => 'hurricanes.png' )
-florida = Team.create!( :title => 'Florida Panthers (East/Southeast)', :key => 'florida', :img => 'panthers.png' )
-tampabay = Team.create!( :title => 'Tampa Bay Lightning (East/Southeast)', :key => 'tampabay', :img => 'lightning.png' )
-washington = Team.create!( :title => 'Washington Capitals (East/Southeast)', :key => 'washington', :img => 'capitals.png' )
-winnipeg = Team.create!( :title => 'Winnipeg Jets (East/Southeast)', :key => 'winnipeg', :img => 'jets.png' )
-
-chicago = Team.create!( :title => 'Chicago Blackhawks (West/Central)', :key => 'chicago', :img => 'blackhawks.png' )
-columbus = Team.create!( :title => 'Columbus Blue Jackets (West/Central)', :key => 'columbus', :img => 'bluejackets.png' )
-detroit = Team.create!( :title => 'Detroit Red Wings (West/Central)', :key => 'detroit', :img => 'redwings.png' )
-nashville = Team.create!( :title => 'Nashville Predators (West/Central)', :key => 'nashville', :img => 'predators.png' )
-stlouis = Team.create!( :title => 'St. Louis Blues (West/Central)', :key => 'stlouis', :img => 'blues.png' )
-
-calgary = Team.create!( :title => 'Calgary Flames (West/Northwest)', :key => 'calgary', :img => 'flames.png' )
-colorado = Team.create!( :title => 'Colorado Avalanche (West/Northwest)', :key => 'colorado', :img => 'avalanche.png' )
-edmonton = Team.create!( :title => 'Edmonton Oilers (West/Northwest)', :key => 'edmonton', :img => 'oilers.png' )
-minnesota = Team.create!( :title => 'Minnesota Wild (West/Northwest)', :key => 'minnesota', :img => 'wild.png' )
-vancouver = Team.create!( :title => 'Vancouver Canucks (West/Northwest)', :key => 'vancouver', :img => 'canucks.png' )
-
-anaheim = Team.create!( :title => 'Anaheim Ducks (West/Pacific)', :key => 'anaheim', :img => 'ducks.png' )
-dallas = Team.create!( :title => 'Dallas Stars (West/Pacific)', :key => 'dallas', :img => 'stars.png' )
-losangeles = Team.create!( :title => 'Los Angeles Kings (West/Pacific)', :key => 'losangeles', :img => 'kings.png' )
-phoenix = Team.create!( :title => 'Phoenix Coyotes (West/Pacific)', :key => 'phoenix', :img => 'coyotes.png' )
-sanjose = Team.create!( :title => 'San Jose Sharks (West/Pacific)', :key => 'sanjose', :img => 'sharks.png' )
-
-
-nhl.teams << anaheim
-nhl.teams << boston
-nhl.teams << buffalo
-nhl.teams << calgary
-nhl.teams << carolina
-nhl.teams << chicago
-nhl.teams << colorado
-nhl.teams << columbus
-nhl.teams << dallas
-nhl.teams << detroit
-nhl.teams << edmonton
-nhl.teams << florida
-nhl.teams << losangeles
-nhl.teams << minnesota
-nhl.teams << montreal
-nhl.teams << nashville
-nhl.teams << newjersey
-nhl.teams << nyislanders
-nhl.teams << nyrangers
-nhl.teams << ottawa
-nhl.teams << philadelphia
-nhl.teams << phoenix
-nhl.teams << pittsburgh
-nhl.teams << sanjose
-nhl.teams << stlouis
-nhl.teams << tampabay
-nhl.teams << toronto
-nhl.teams << vancouver
-nhl.teams << washington
-nhl.teams << winnipeg
-
-## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.nhl.version', :value => '1' )
View
@@ -0,0 +1,49 @@
+# encoding: utf-8
+
+puts "*** loading seed data in seeds/nhl/teams.rb"
+
+######################################
+## NHL Teams 2012
+
+teams = [
+ [ 'newjersey', 'New Jersey Devils', 'East/Atlantic', 'nhl/devils.png' ],
+ [ 'nyislanders', 'New York Islanders', 'East/Atlantic', 'nhl/islanders.png' ],
+ [ 'nyrangers', 'New York Rangers', 'East/Atlantic', 'nhl/rangers.png' ],
+ [ 'philadelphia', 'Philadelphia Flyers', 'East/Atlantic', 'nhl/flyers.png' ],
+ [ 'pittsburgh', 'Pittsburgh Penguins', 'East/Atlantic', 'nhl/penguins.png' ],
+
+ [ 'boston', 'Boston Bruis', 'East/Northeast', 'nhl/bruins.png' ],
+ [ 'buffalo', 'Buffalo Sabres', 'East/Northeast', 'nhl/sabres.png' ],
+ [ 'montreal', 'Montreal Canadiens', 'East/Northeast', 'nhl/canadiens.png' ],
+ [ 'ottawa', 'Ottawa Senators', 'East/Northeast', 'nhl/senators.png' ],
+ [ 'toronto', 'Toronto Maple Leafs', 'East/Northeast', 'nhl/mapleleafs.png' ],
+
+ [ 'carolina', 'Carolina Hurricanes', 'East/Southeast', 'nhl/hurricanes.png' ],
+ [ 'florida', 'Florida Panthers', 'East/Southeast', 'nhl/panthers.png' ],
+ [ 'tampabay', 'Tampa Bay Lightning', 'East/Southeast', 'nhl/lightning.png' ],
+ [ 'washington', 'Washington Capitals', 'East/Southeast', 'nhl/capitals.png' ],
+ [ 'winnipeg', 'Winnipeg Jets', 'East/Southeast', 'nhl/jets.png' ],
+
+ [ 'chicago', 'Chicago Blackhawks', 'West/Central', 'nhl/blackhawks.png' ],
+ [ 'columbus', 'Columbus Blue Jackets', 'West/Central', 'nhl/bluejackets.png' ],
+ [ 'detroit', 'Detroit Red Wings', 'West/Central', 'nhl/redwings.png' ],
+ [ 'nashville', 'Nashville Predators', 'West/Central', 'nhl/predators.png' ],
+ [ 'stlouis', 'St. Louis Blues', 'West/Central', 'nhl/blues.png' ],
+
+ [ 'calgary', 'Calgary Flames', 'West/Northwest', 'nhl/flames.png' ],
+ [ 'colorado', 'Colorado Avalanche', 'West/Northwest', 'nhl/avalanche.png' ],
+ [ 'edmonton', 'Edmonton Oilers', 'West/Northwest', 'nhl/oilers.png' ],
+ [ 'minnesota', 'Minnesota Wild', 'West/Northwest', 'nhl/wild.png' ],
+ [ 'vancouver', 'Vancouver Canucks', 'West/Northwest', 'nhl/canucks.png' ],
+
+ [ 'anaheim', 'Anaheim Ducks', 'West/Pacific', 'nhl/ducks.png' ],
+ [ 'dallas', 'Dallas Stars', 'West/Pacific', 'nhl/stars.png' ],
+ [ 'losangeles', 'Los Angeles Kings', 'West/Pacific', 'nhl/kings.png' ],
+ [ 'phoenix', 'Phoenix Coyotes', ' West/Pacific', 'nhl/coyotes.png' ],
+ [ 'sanjose', 'San Jose Sharks', ' West/Pacific', 'nhl/sharks.png' ]
+]
+
+Team.create_from_ary!( teams )
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( :key => 'db.seeds.nhl.teams.version', :value => '1' )
@@ -2,26 +2,30 @@
# note: timezone for games (play_at) is *always* CET (central european time)
-puts "*** loading seed data in seeds/world/quali.rb"
+puts "*** loading seed data in seeds/world/quali_2012_13.rb"
#################################
## WM 2014 - Qualification Europe
-world = Event.create!( :title => 'WM Quali. Europa 2012/13', :key => 'wmql', :start_at => Time.cet( '2012-09-07 00:00' ))
+world = Event.create!( :title => 'WM Quali. Europa 2012/13',
+ :key => 'wmql',
+ :start_at => Time.cet( '2012-09-07 00:00' ))
worldc = Group.create!( :event => world, :pos => 1, :title => 'Gruppe C' )
#################################3
# Gruppe C
-ger = Team.create!( :title => 'Deutschland', :tag => 'GER', :key => 'ger', :img => 'euro/germany2.png' )
-fro = Team.create!( :title => 'Färöer', :tag => 'FRO', :key => 'fro', :img => 'euro/faroer2.png' )
-irl = Team.create!( :title => 'Irland', :tag => 'IRL', :key => 'irl', :img => 'euro/ireland2.png' )
-kaz = Team.create!( :title => 'Kasachstan', :tag => 'KAZ', :key => 'kaz', :img => 'euro/kaz2.png' )
-aut = Team.create!( :title => 'Österreich', :tag => 'AUT', :key => 'aut', :img => 'euro/austria2.png' )
-swe = Team.create!( :title => 'Schweden', :tag => 'SWE', :key => 'swe', :img => 'euro/sweden2.png' )
+# note: for teams see seeds/euro/teams.rb
+
+ger = Team.find_by_key!( 'ger' )
+fro = Team.find_by_key!( 'fro' )
+irl = Team.find_by_key!( 'irl' )
+kaz = Team.find_by_key!( 'kaz' )
+aut = Team.find_by_key!( 'aut' )
+swe = Team.find_by_key!( 'swe' )
worldc.teams << ger
worldc.teams << fro
@@ -97,4 +101,4 @@
Game.create_from_ary!( games_world6, world6 )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.world.quali.version', :value => '1' )
+Prop.create!( :key => 'db.seeds.world.quali.2012/13.version', :value => '1' )
@@ -3,7 +3,10 @@ desc "wettpool: load seed data for uss other pools"
task :load_uss_others => [:environment] do |t|
# ['services', 'austria/austria2013', 'world/quali', 'uss/users' ].each do |seed|
- ['services', 'austria/teams', 'austria/bl_2011_12', 'austria/cup_2011_12', 'austria/bl_2012_13', 'austria/cup_2012_13', 'uss/users' ].each do |seed|
+ # ['services', 'austria/teams', 'austria/bl_2011_12', 'austria/cup_2011_12', 'austria/bl_2012_13', 'austria/cup_2012_13', 'uss/users' ].each do |seed|
+ ['services', 'euro/teams', 'euro/2012',
+ 'world/quali_2012_13',
+ 'uss/users' ].each do |seed|
require "#{Rails.root}/db/seeds/#{seed}.rb"
end

0 comments on commit aeb6950

Please sign in to comment.