Permalink
Browse files

add country to teams; add club/national flag

  • Loading branch information...
1 parent 0cee4c4 commit d324cbe28e1dc2fa4276b9d65e1c6db4118c0b44 @geraldb geraldb committed Oct 9, 2012
View
@@ -58,84 +58,86 @@
bl20 = Round.create!( :event => bl, :pos => 20, :title => '20. Runde', :title2 => '15. Dez 2012' )
+## todo: fix game dates - do not use 00:00
+
games_bl01 = [
- [ 1, sturm, [], salzburg, Time.cet('2012-07-21 16:00') ],
- [ 2, rapid, [], wacker, Time.cet('2012-07-21 18:30') ],
- [ 3, mattersburg, [], neustadt, Time.cet('2012-07-21 18:30') ],
- [ 4, wac, [], austria, Time.cet('2012-07-21 18:30') ],
- [ 5, admira, [], ried, Time.cet('2012-07-22 16:00') ]
+ [ 1, sturm, [0,2], salzburg, Time.cet('2012-07-21 16:00') ],
+ [ 2, rapid, [4,0], wacker, Time.cet('2012-07-21 18:30') ],
+ [ 3, mattersburg, [2,0], neustadt, Time.cet('2012-07-21 18:30') ],
+ [ 4, wac, [0,1], austria, Time.cet('2012-07-25 18:30') ], # NB: date changed
+ [ 5, admira, [0,2], ried, Time.cet('2012-07-22 16:00') ]
]
games_bl02 = [
- [ 1, neustadt, [], rapid, Time.cet('2012-07-28 18:30') ],
- [ 2, salzburg, [], mattersburg, Time.cet('2012-07-28 18:30') ],
- [ 3, austria, [], sturm, Time.cet('2012-07-28 18:30') ],
- [ 4, wacker, [], admira, Time.cet('2012-07-29 16:00') ],
- [ 5, ried, [], wac, Time.cet('2012-07-29 18:30') ]
+ [ 1, neustadt, [0,1], rapid, Time.cet('2012-07-28 18:30') ],
+ [ 2, salzburg, [3,2], mattersburg, Time.cet('2012-07-28 18:30') ],
+ [ 3, austria, [0,1], sturm, Time.cet('2012-07-28 18:30') ],
+ [ 4, wacker, [1,2], admira, Time.cet('2012-07-29 16:00') ],
+ [ 5, ried, [0,2], wac, Time.cet('2012-07-29 18:30') ]
]
games_bl03 = [
- [ 1, ried, [], wacker, Time.cet('2012-08-04 18:30') ],
- [ 2, mattersburg, [], sturm, Time.cet('2012-08-04 18:30') ],
- [ 3, wac, [], salzburg, Time.cet('2012-08-04 18:30') ],
- [ 4, admira, [], neustadt, Time.cet('2012-08-04 18:30') ],
- [ 5, rapid, [], austria, Time.cet('2012-08-05 16:00') ]
+ [ 1, ried, [2,0], wacker, Time.cet('2012-08-04 18:30') ],
+ [ 2, mattersburg, [3,1], sturm, Time.cet('2012-08-04 18:30') ],
+ [ 3, wac, [0,2], salzburg, Time.cet('2012-08-04 18:30') ],
+ [ 4, admira, [4,0], neustadt, Time.cet('2012-08-04 18:30') ],
+ [ 5, rapid, [0,3], austria, Time.cet('2012-08-05 16:00') ]
]
games_bl04 = [
- [ 1, neustadt, [], ried, Time.cet('2012-08-11 00:00') ],
- [ 2, sturm, [], wac, Time.cet('2012-08-11 00:00') ],
- [ 3, salzburg, [], rapid, Time.cet('2012-08-11 00:00') ],
- [ 4, austria, [], admira, Time.cet('2012-08-11 00:00') ],
- [ 5, wacker, [], mattersburg, Time.cet('2012-08-11 00:00') ]
+ [ 1, neustadt, [2,3], ried, Time.cet('2012-08-11 00:00') ],
+ [ 2, sturm, [4,1], wac, Time.cet('2012-08-11 00:00') ],
+ [ 3, salzburg, [0,2], rapid, Time.cet('2012-08-11 00:00') ],
+ [ 4, austria, [1,0], admira, Time.cet('2012-08-11 00:00') ],
+ [ 5, wacker, [2,1], mattersburg, Time.cet('2012-08-11 00:00') ]
]
games_bl05 = [
- [ 1, ried, [], austria, Time.cet('2012-08-18 00:00') ],
- [ 2, rapid, [], sturm, Time.cet('2012-08-18 00:00') ],
- [ 3, wacker, [], neustadt, Time.cet('2012-08-18 00:00') ],
- [ 4, wac, [], mattersburg, Time.cet('2012-08-18 00:00') ],
- [ 5, admira, [], salzburg, Time.cet('2012-08-18 00:00') ]
+ [ 1, ried, [0,1], austria, Time.cet('2012-08-18 00:00') ],
+ [ 2, rapid, [3,0], sturm, Time.cet('2012-08-18 00:00') ],
+ [ 3, wacker, [2,3], neustadt, Time.cet('2012-08-18 00:00') ],
+ [ 4, wac, [0,1], mattersburg, Time.cet('2012-08-18 00:00') ],
+ [ 5, admira, [4,4], salzburg, Time.cet('2012-08-18 00:00') ]
]
games_bl06 = [
- [ 1, sturm, [], admira, Time.cet('2012-08-25 00:00') ],
- [ 2, salzburg, [], neustadt, Time.cet('2012-08-25 00:00') ],
- [ 3, austria, [], wacker, Time.cet('2012-08-25 00:00') ],
- [ 4, mattersburg, [], ried, Time.cet('2012-08-25 00:00') ],
- [ 5, wac, [], rapid, Time.cet('2012-08-25 00:00') ]
+ [ 1, sturm, [3,2], admira, Time.cet('2012-08-25 00:00') ],
+ [ 2, salzburg, [1,1], neustadt, Time.cet('2012-08-25 00:00') ],
+ [ 3, austria, [2,0], wacker, Time.cet('2012-08-25 00:00') ],
+ [ 4, mattersburg, [2,1], ried, Time.cet('2012-08-25 00:00') ],
+ [ 5, wac, [1,0], rapid, Time.cet('2012-08-25 00:00') ]
]
games_bl07 = [
- [ 1, ried, [], sturm, Time.cet('2012-09-01 00:00') ],
- [ 2, neustadt,[], austria, Time.cet('2012-09-01 00:00') ],
- [ 3, rapid, [], mattersburg, Time.cet('2012-09-01 00:00') ],
- [ 4, wacker, [], salzburg, Time.cet('2012-09-01 00:00') ],
- [ 5, admira, [], wac, Time.cet('2012-09-01 00:00') ]
+ [ 1, ried, [0,1], sturm, Time.cet('2012-09-01 00:00') ],
+ [ 2, neustadt,[0,2], austria, Time.cet('2012-09-01 00:00') ],
+ [ 3, rapid, [3,0], mattersburg, Time.cet('2012-09-01 00:00') ],
+ [ 4, wacker, [0,4], salzburg, Time.cet('2012-09-01 00:00') ],
+ [ 5, admira, [1,1], wac, Time.cet('2012-09-01 00:00') ]
]
games_bl08 = [
- [ 1, sturm, [], wacker, Time.cet('2012-09-15 00:00') ],
- [ 2, salzburg, [], ried, Time.cet('2012-09-15 00:00') ],
- [ 3, rapid, [], admira, Time.cet('2012-09-15 00:00') ],
- [ 4, mattersburg, [], austria, Time.cet('2012-09-15 00:00') ],
- [ 5, wac, [], neustadt, Time.cet('2012-09-15 00:00') ]
+ [ 1, sturm, [3,0], wacker, Time.cet('2012-09-15 00:00') ],
+ [ 2, salzburg, [1,1], ried, Time.cet('2012-09-15 00:00') ],
+ [ 3, rapid, [0,0], admira, Time.cet('2012-09-15 00:00') ],
+ [ 4, mattersburg, [2,4], austria, Time.cet('2012-09-15 00:00') ],
+ [ 5, wac, [6,0], neustadt, Time.cet('2012-09-15 00:00') ]
]
games_bl09 = [
- [ 1, ried, [], rapid, Time.cet('2012-09-22 00:00') ],
- [ 2, neustadt,[], sturm, Time.cet('2012-09-22 00:00') ],
- [ 3, austria, [], salzburg, Time.cet('2012-09-22 00:00') ],
- [ 4, wacker, [], wac, Time.cet('2012-09-22 00:00') ],
- [ 5, admira, [], mattersburg, Time.cet('2012-09-22 00:00') ]
+ [ 1, ried, [0,2], rapid, Time.cet('2012-09-22 00:00') ],
+ [ 2, neustadt,[1,1], sturm, Time.cet('2012-09-22 00:00') ],
+ [ 3, austria, [0,1], salzburg, Time.cet('2012-09-22 00:00') ],
+ [ 4, wacker, [0,1], wac, Time.cet('2012-09-22 00:00') ],
+ [ 5, admira, [5,1], mattersburg, Time.cet('2012-09-22 00:00') ]
]
games_bl10 = [
- [ 1, salzburg, [], sturm, Time.cet('2012-09-29 00:00') ],
- [ 2, wacker, [], rapid, Time.cet('2012-09-29 00:00') ],
- [ 3, neustadt, [], mattersburg, Time.cet('2012-09-29 00:00') ],
- [ 4, austria, [], wac, Time.cet('2012-09-29 00:00') ],
- [ 5, ried, [], admira, Time.cet('2012-09-29 00:00') ]
+ [ 1, salzburg, [3,2], sturm, Time.cet('2012-09-29 00:00') ],
+ [ 2, wacker, [0,2], rapid, Time.cet('2012-09-29 00:00') ],
+ [ 3, neustadt, [0,0], mattersburg, Time.cet('2012-09-29 00:00') ],
+ [ 4, austria, [1,1], wac, Time.cet('2012-09-29 00:00') ],
+ [ 5, ried, [1,1], admira, Time.cet('2012-09-29 00:00') ]
]
games_bl11 = [
View
@@ -1,7 +1,5 @@
# encoding: utf-8
-at = Country.find_by_key!( 'at' )
-
bl = [
[ 'salzburg', 'FC RB Salzburg', 'RBS' ],
[ 'rapid', 'SK Rapid Wien', 'RAP' ],
@@ -85,13 +83,8 @@
[ 'juniors', 'FC RB Juniors Salzburg' ]
]
+at = Country.find_by_key!( 'at' )
-Team.create_clubs_from_ary_for_country!( bl, at )
-Team.create_clubs_from_ary_for_country!( ersteliga, at )
-Team.create_clubs_from_ary_for_country!( rlwest, at )
-Team.create_clubs_from_ary_for_country!( rlmitte, at )
-Team.create_clubs_from_ary_for_country!( rlost, at )
-Team.create_clubs_from_ary_for_country!( misc, at )
-
+Team.create_from_ary!( bl+ersteliga+rlwest+rlmitte+rlost+misc, club: true, country: at )
-Prop.create!( :key => 'db.at.teams.version', :value => '1' )
+Prop.create!( key: 'db.at.teams.version', value: '1' )
View
@@ -1,66 +1,91 @@
# encoding: utf-8
+de = Country.find_by_key!( 'de' )
+at = Country.find_by_key!( 'at' )
+es = Country.find_by_key!( 'es' )
+fr = Country.find_by_key!( 'fr' )
+en = Country.find_by_key!( 'en' )
+pl = Country.find_by_key!( 'pl' )
+gr = Country.find_by_key!( 'gr' )
+ru = Country.find_by_key!( 'ru' )
+cz = Country.find_by_key!( 'cz' )
+nl = Country.find_by_key!( 'nl' )
+dk = Country.find_by_key!( 'dk' )
+pt = Country.find_by_key!( 'pt' )
+it = Country.find_by_key!( 'it' )
+hr = Country.find_by_key!( 'hr' )
+ua = Country.find_by_key!( 'ua' )
+be = Country.find_by_key!( 'be' )
+by = Country.find_by_key!( 'by' )
+sc = Country.find_by_key!( 'sc' )
+ro = Country.find_by_key!( 'ro' )
+tr = Country.find_by_key!( 'tr' )
+ch = Country.find_by_key!( 'ch' )
+mt = Country.find_by_key!( 'mt' )
+
+
teams = [
- [ 'porto', 'FC Porto' ],
- [ 'kiew', 'Dynamo Kiew' ],
- [ 'paris', 'Paris St. Germain' ],
- [ 'zagreb', 'Dinamo Zagreb' ],
-
- [ 'arsenal', 'FC Arsenal' ],
- [ 'schalke', 'FC Schalke 04' ],
- [ 'olympiacos', 'Olympiakos Piräus' ],
- [ 'montpellier', 'HSC Montpellier' ],
-
- [ 'milan', 'AC Mailand' ],
- [ 'zenit', 'Zenit St. Petersburg' ],
- [ 'anderlecht', 'RSC Anderlecht' ],
- [ 'malaga', 'FC Málaga' ],
-
- [ 'madrid', 'Real Madrid' ],
- [ 'mancity', 'Manchester City' ],
- [ 'ajax', 'Ajax Amsterdam' ],
- [ 'dortmund', 'Borussia Dortmund' ],
-
- [ 'chelsea', 'FC Chelsea' ],
- [ 'donezk', 'Schachtjor Donezk' ],
- [ 'juventus', 'Juventus Turin' ],
- [ 'nordsjalland', 'FC Nordsjælland' ],
-
- [ 'bayern', 'Bayern München' ],
- [ 'valencia', 'FC Valencia' ],
- [ 'lille', 'OSC Lille' ],
- [ 'borissow', 'BATE Borissow' ],
-
- [ 'barcelona', 'FC Barcelona' ],
- [ 'benfica', 'Benfica Lissabon' ],
- [ 'spartak', 'Spartak Moskau' ],
- [ 'celtic', 'Celtic Glasgow' ],
-
- [ 'manunited', 'Manchester United' ],
- [ 'braga', 'Sporting Braga' ],
- [ 'galatasaray', 'Galatasaray' ],
- [ 'cluj', 'CFR Cluj' ],
+ [ 'porto', 'FC Porto', pt ],
+ [ 'kiew', 'Dynamo Kiew', ua ],
+ [ 'paris', 'Paris St. Germain', fr ],
+ [ 'zagreb', 'Dinamo Zagreb', hr ],
+
+ [ 'arsenal', 'FC Arsenal', en ],
+ [ 'schalke', 'FC Schalke 04', de ],
+ [ 'olympiacos', 'Olympiakos Piräus', gr ],
+ [ 'montpellier', 'HSC Montpellier', fr ],
+
+ [ 'milan', 'AC Mailand', it ],
+ [ 'zenit', 'Zenit St. Petersburg', ru ],
+ [ 'anderlecht', 'RSC Anderlecht', be ],
+ [ 'malaga', 'FC Málaga', es ],
+
+ [ 'madrid', 'Real Madrid', es ],
+ [ 'mancity', 'Manchester City', en ],
+ [ 'ajax', 'Ajax Amsterdam', nl ],
+ [ 'dortmund', 'Borussia Dortmund', de ],
+
+ [ 'chelsea', 'FC Chelsea', en ],
+ [ 'donezk', 'Schachtjor Donezk', ua ],
+ [ 'juventus', 'Juventus Turin', it ],
+ [ 'nordsjalland', 'FC Nordsjælland', dk ],
+
+ [ 'bayern', 'Bayern München', de ],
+ [ 'valencia', 'FC Valencia', es ],
+ [ 'lille', 'OSC Lille', fr ],
+ [ 'borissow', 'BATE Borissow', by ],
+
+ [ 'barcelona', 'FC Barcelona', es ],
+ [ 'benfica', 'Benfica Lissabon', pt ],
+ [ 'spartak', 'Spartak Moskau', ru ],
+ [ 'celtic', 'Celtic Glasgow', sc ],
+
+ [ 'manunited', 'Manchester United', en ],
+ [ 'braga', 'Sporting Braga', pt ],
+ [ 'galatasaray', 'Galatasaray', tr ],
+ [ 'cluj', 'CFR Cluj', ro ],
###################
# more teams from cl/el 2011-12
#
- [ 'inter', 'FC Internazionale Milano' ],
- [ 'marseille', 'Olympique Marseille' ],
- [ 'basel', 'FC Basel 1893' ],
- [ 'napoli', 'SSC Napoli' ],
- [ 'moskva', 'PFC CSKA Moskva' ],
- [ 'apoel', 'APOEL Nikosia' ],
-
- [ 'az', 'AZ Alkmaar' ],
- [ 'athletic', 'Athletic Bilbao' ],
- [ 'sporting', 'Sporting Lisboa' ],
- [ 'metalist', 'FC Metalist Kharkiv' ],
- [ 'atletico', 'Atlético Madrid' ],
- [ 'hannover', 'Hannover 96' ]
+ [ 'inter', 'FC Internazionale Milano', it ],
+ [ 'marseille', 'Olympique Marseille', fr ],
+ [ 'basel', 'FC Basel 1893', ch ],
+ [ 'napoli', 'SSC Napoli', it ],
+ [ 'moskva', 'PFC CSKA Moskva', ru ],
+ [ 'apoel', 'APOEL Nikosia', mt ],
+
+ [ 'az', 'AZ Alkmaar', nl ],
+ [ 'athletic', 'Athletic Bilbao', es ],
+ [ 'sporting', 'Sporting Lisboa', pt ],
+ [ 'metalist', 'FC Metalist Kharkiv', ua ],
+ [ 'atletico', 'Atlético Madrid', es ],
+ [ 'hannover', 'Hannover 96', de ]
]
-Team.create_from_ary!( teams )
+
+Team.create_from_ary!( teams, club: true )
-Prop.create!( :key => 'db.cl.teams.version', :value => '1' )
-Prop.create!( :key => 'db.el.teams.version', :value => '1' )
+Prop.create!( key: 'db.cl.teams.version', value: '1' )
+Prop.create!( key: 'db.el.teams.version', value: '1' )
View
@@ -1,35 +1,45 @@
# encoding: utf-8
## NB: for keys use internet two letter code
-## what to do for england (uk - use en?)
countries = [
[ 'de', 'Deutschland', 'GER' ],
[ 'at', 'Österreich', 'AUT' ],
[ 'es', 'Spanien', 'ESP' ],
[ 'fr', 'Frankreich', 'FRA' ],
- [ 'en', 'England', 'ENG' ],
-## todo: add more countries, cleanup keys
-
- [ 'pol', 'Polen', 'POL' ],
- [ 'gre', 'Griechenland', 'GRE' ],
- [ 'rus', 'Russland', 'RUS' ],
- [ 'cze', 'Tschechien', 'CZE' ],
- [ 'ned', 'Niederlande', 'NED' ],
- [ 'den', 'Dänemark', 'DEN' ],
- [ 'por', 'Portugal', 'POR' ],
- [ 'ita', 'Italien', 'ITA' ],
- [ 'irl', 'Irland', 'IRL' ],
- [ 'cro', 'Kroatien', 'CRO' ],
- [ 'ukr', 'Ukraine', 'UKR' ],
- [ 'swe', 'Schweden', 'SWE' ],
- [ 'fro', 'Färöer', 'FRO' ],
- [ 'kaz', 'Kasachstan', 'KAZ' ]
+ [ 'en', 'England', 'ENG' ], # NB: not a valid internet country domain? - it's uk - what to use - anything better?
+ [ 'sc', 'Schottland', 'SCO' ], # NB: not a valid internet country domain? - it's uk - what to use - anything better?
+
+ [ 'pl', 'Polen', 'POL' ],
+ [ 'gr', 'Griechenland', 'GRE' ],
+ [ 'ru', 'Russland', 'RUS' ],
+ [ 'cz', 'Tschechien', 'CZE' ],
+ [ 'nl', 'Niederlande', 'NED' ],
+ [ 'dk', 'Dänemark', 'DEN' ],
+ [ 'pt', 'Portugal', 'POR' ],
+ [ 'it', 'Italien', 'ITA' ],
+ [ 'ie', 'Irland', 'IRL' ],
+ [ 'hr', 'Kroatien', 'CRO' ], # NB: local name: Hrvatska
+ [ 'ua', 'Ukraine', 'UKR' ],
+ [ 'se', 'Schweden', 'SWE' ],
+ [ 'fo', 'Färöer', 'FRO' ], # todo: check if domain fo exists?
+
+ [ 'be', 'Belgien', 'BEL' ],
+ [ 'by', 'Belarus', 'BLR' ],
+ [ 'ro', 'Rumänien', 'ROM' ],
+ [ 'tr', 'Türkei', 'TUR' ],
+ [ 'ch', 'Schweiz', 'CHE' ],
+ [ 'mt', 'Malta', 'MLT' ],
+
+ [ 'kz', 'Kasachstan', 'KAZ' ],
+
+ [ 'mx', 'Mexiko', 'MEX' ],
+ [ 'us', 'United States', 'USA' ]
]
Country.create_from_ary!( countries )
-Prop.create!( :key => 'db.countries.version', :value => '1' )
+Prop.create!( key: 'db.countries.version', value: '1' )
Oops, something went wrong.

0 comments on commit d324cbe

Please sign in to comment.