db/de/2012_13/bl.rb in sportdb-0.4.3 vs db/de/2012_13/bl.rb in sportdb-0.4.4
- old
+ new
@@ -10,48 +10,29 @@
bl = Event.create!( key: 'de.2012/13',
title: 'Deutsche Bundesliga 2012/13',
start_at: Time.cet('2012-07-21 00:00') )
+team_keys_bl = [
+ 'bayern',
+ 'frankfurt',
+ 'schalke',
+ 'dortmund',
+ 'hannover',
+ 'leverkusen',
+ 'duesseldorf',
+ 'hsv',
+ 'mainz',
+ 'mgladbach',
+ 'freiburg',
+ 'bremen',
+ 'hoffenheim',
+ 'nuernberg',
+ 'stuttgart',
+ 'augsburg',
+ 'wolfsburg',
+ 'fuerth' ]
-bayern = Team.find_by_key!( 'bayern' )
-frankfurt = Team.find_by_key!( 'frankfurt' )
-schalke = Team.find_by_key!( 'schalke' )
-dortmund = Team.find_by_key!( 'dortmund' )
-hannover = Team.find_by_key!( 'hannover' )
-leverkusen = Team.find_by_key!( 'leverkusen' )
-duesseldorf = Team.find_by_key!( 'duesseldorf' )
-hsv = Team.find_by_key!( 'hsv' )
-mainz = Team.find_by_key!( 'mainz' )
-mgladbach = Team.find_by_key!( 'mgladbach' )
-freiburg = Team.find_by_key!( 'freiburg' )
-bremen = Team.find_by_key!( 'bremen' )
-hoffenheim = Team.find_by_key!( 'hoffenheim' )
-nuernberg = Team.find_by_key!( 'nuernberg' )
-stuttgart = Team.find_by_key!( 'stuttgart' )
-augsburg = Team.find_by_key!( 'augsburg' )
-wolfsburg = Team.find_by_key!( 'wolfsburg' )
-fuerth = Team.find_by_key!( 'fuerth' )
+bl.add_teams_from_ary!( team_keys_bl )
-
-bl.teams << bayern
-bl.teams << frankfurt
-bl.teams << schalke
-bl.teams << dortmund
-bl.teams << hannover
-bl.teams << leverkusen
-bl.teams << duesseldorf
-bl.teams << hsv
-bl.teams << mainz
-bl.teams << mgladbach
-bl.teams << freiburg
-bl.teams << bremen
-bl.teams << hoffenheim
-bl.teams << nuernberg
-bl.teams << stuttgart
-bl.teams << augsburg
-bl.teams << wolfsburg
-bl.teams << fuerth
-
-
-Prop.create!( key: 'db.de.bl.2012/13.version', value: '1' )
+Prop.create!( key: 'db.de.2012/13.version', value: '1' )
\ No newline at end of file