Browse files

cleanup seeds

  • Loading branch information...
1 parent 80815bb commit 6a38d842e84304a079e5b97dba08313ec64b14d7 @geraldb geraldb committed Nov 17, 2012
Showing with 124 additions and 407 deletions.
  1. +3 −8 db/migrate/001_create_db.rb
  2. +11 −16 db/seeds.rb
  3. +0 −1 db/seeds/at/2011_12/bl.rb
  4. +0 −3 db/seeds/at/2011_12/cup.rb
  5. +0 −1 db/seeds/at/2012_13/bl.rb
  6. +0 −5 db/seeds/at/2012_13/cup.rb
  7. +4 −5 db/seeds/at/teams.rb
  8. +8 −17 db/seeds/at/{2012_13/cup_2.rb → update.rb}
  9. +0 −9 db/seeds/cl/2011_12/cl.rb
  10. +0 −6 db/seeds/cl/2011_12/el.rb
  11. +0 −9 db/seeds/cl/2012_13/cl.rb
  12. +2 −2 db/seeds/cl/teams.rb
  13. +2 −5 db/seeds/cl/{2012_13/cl_2.rb → update.rb}
  14. +0 −14 db/seeds/demo/users.rb
  15. +2 −218 db/seeds/euro/2012.rb
  16. +1 −1 db/seeds/euro/2012_calc.rb
  17. +1 −1 db/seeds/euro/teams.rb
  18. +0 −2 db/seeds/mx/apertura_2012.rb
  19. +1 −1 db/seeds/mx/teams.rb
  20. +1 −1 db/seeds/nhl/teams.rb
  21. +0 −2 db/seeds/ro/l1_2012_13.rb
  22. +1 −1 db/seeds/ro/teams.rb
  23. +5 −5 db/seeds/{ → setups}/demo/pools.rb
  24. +14 −0 db/seeds/setups/demo/users.rb
  25. +34 −0 db/seeds/setups/uss/euro/bonus.rb
  26. +1 −1 db/seeds/{uss/euro_bonus2.rb → setups/uss/euro/bonus2.rb}
  27. 0 db/seeds/{uss/euro_data.txt → setups/uss/euro/data.txt}
  28. 0 db/seeds/{uss/euro_pools.rb → setups/uss/euro/pools.rb}
  29. 0 db/seeds/{ → setups}/uss/others_data.txt
  30. +26 −0 db/seeds/setups/uss/others_pools.rb
  31. +1 −1 db/seeds/{ → setups}/uss/others_pools2.rb
  32. +1 −1 db/seeds/{ → setups}/uss/users.rb
  33. +2 −2 db/seeds/{ → setups}/ussr/pools.rb
  34. +1 −1 db/seeds/{ → setups}/ussr/users.rb
  35. +0 −34 db/seeds/uss/euro_bonus.rb
  36. +0 −26 db/seeds/uss/others_pools.rb
  37. +0 −2 db/seeds/world/quali_2012_13.rb
  38. +2 −6 db/seeds/world/{quali_2012_13_2.rb → update.rb}
View
11 db/migrate/001_create_db.rb
@@ -8,9 +8,9 @@ class CreateDb < ActiveRecord::Migration
def up
- ## fix/todo: add WorldDB::CreateDB.up - (now called in SportDB::CreateDB.up; remove it there)
- SportDB::CreateDB.up
- SportDB::Market::CreateDB.up
+ WorldDB.create
+ SportDB.create
+ SportDB::Market::CreateDB.up ### fix: rename to SportDB::Market.create
#####################################
## add columns / change tables
@@ -28,11 +28,6 @@ def up
end
-change_table :events do |t|
- t.boolean :team3, :null => false, :default => true ## e.g. Champions League has no 3rd place (only 1st and 2nd/final)
-end
-
-
change_table :rounds do |t|
# to avoid duplicates allow (re)use of rounds for fix/flex pools by default
View
27 db/seeds.rb
@@ -3,18 +3,16 @@
SportDB.delete! # danger zone! deletes all records
SportDB::Market.delete! # danger zone! deletes all records
- WorldDB.load([
- 'countries',
- 'cities',
- 'at/cities',
- 'de/cities'
- ])
-
+
+ WorldDB.read_all
+
+
SportDB.load([
'leagues',
'seasons',
'de/teams',
'en/teams',
+ 'es/teams',
'cl/teams',
'cl/2012_13/cl',
'euro/teams',
@@ -27,14 +25,11 @@
])
-=begin
-['cl/teams', 'cl/2012_13/cl', 'cl/2012_13/cl_quotes',
- 'euro/teams', 'world/quali_2012_13',
- 'demo/users', 'demo/pools'].each do |seed|
- puts "*** loading seed data in '#{seed}'..."
- require "#{Rails.root}/db/seeds/#{seed}.rb"
-end
-=end
+ ['cl/teams', 'euro/teams',
+ 'setups/demo/users', 'setups/demo/pools'].each do |seed|
+ puts "*** loading seed data in '#{seed}'..."
+ require "#{Rails.root}/db/seeds/#{seed}.rb"
+ end
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.version', :value => '1' )
+Prop.create!( key: 'db.seeds.version', value: '1' )
View
1 db/seeds/at/2011_12/bl.rb
@@ -1 +0,0 @@
-## nothing here
View
3 db/seeds/at/2011_12/cup.rb
@@ -1,3 +0,0 @@
-
-
-Event.find_by_key!( 'at_cup_2011_12' ).update_attributes!( :team3 => false )
View
1 db/seeds/at/2012_13/bl.rb
@@ -1 +0,0 @@
-## nothing here
View
5 db/seeds/at/2012_13/cup.rb
@@ -1,5 +0,0 @@
-
-
-Event.find_by_key!( 'at_cup_2012_13' ).update_attributes!( :team3 => false )
-
-
View
9 db/seeds/at/teams.rb
@@ -10,9 +10,9 @@
[ 'austria', 'at/austria.png' ],
[ 'sturm', 'at/sturm.png' ],
[ 'ried', 'at/ried.png' ],
- [ 'wacker', 'at/wacker.png' ],
+ [ 'innsbruck', 'at/wacker.png' ], ## todo: update image to new key
[ 'mattersburg', 'at/mattersburg.png' ],
- [ 'neustadt', 'at/neustadt.png' ],
+ [ 'wrneustadt', 'at/neustadt.png' ], ## todo: update iamge to new key
[ 'wac', 'at/wac.png' ]
]
@@ -31,9 +31,8 @@
-Team.update_image_from_ary!( bl )
-Team.update_image_from_ary!( ersteliga )
+Team.update_image_from_ary!( bl + ersteliga )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.at.teams.2.version', :value => '1' )
+Prop.create!( key: 'db.at.teams.2.version', value: '1' )
View
25 db/seeds/at/2012_13/cup_2.rb → db/seeds/at/update.rb
@@ -1,13 +1,10 @@
# encoding: utf-8
-##################################
-### ÖFB Cup 2012/13 Part II
+##############################################
+### Bundesliga & ÖFB Cup 2012/13 Update
-puts "*** loading seed data in seeds/austria/cup_2012_13_2.rb"
-
-cup = Event.find_by_key!( 'at_cup_2012_13' )
-
-bl = Event.find_by_key!( 'at_bl_2012_13' )
+bl = Event.find_at_2012_13!
+cup = Event.find_at_cup_2012_13!
lask = Team.find_by_key!( 'lask' )
@@ -17,7 +14,7 @@
viktoria = Team.find_by_key!( 'viktoria' )
ried = Team.find_by_key!( 'ried' )
sturm = Team.find_by_key!( 'sturm' )
-wacker = Team.find_by_key!( 'wacker' )
+innsbruck = Team.find_by_key!( 'innsbruck' )
pasching = Team.find_by_key!( 'pasching' )
austriak = Team.find_by_key!( 'austriak' )
lustenau = Team.find_by_key!( 'lustenau' )
@@ -28,8 +25,8 @@
austria = Team.find_by_key!( 'austria' )
# bl clubs
-admira = Team.find_by_key!( 'admira' )
-neustadt = Team.find_by_key!( 'neustadt' )
+admira = Team.find_by_key!( 'admira' )
+wrneustadt = Team.find_by_key!( 'wrneustadt' )
# more clubs
@@ -40,15 +37,9 @@
-
-tipp3 = Service.find_by_key!( 'tipp3' )
-betathome = Service.find_by_key!( 'betathome' )
-
-
-
cup16 = Round.find_by_event_id_and_pos!( cup.id, 3 )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.austria.cup.2012/13.2.version', :value => '1' )
+Prop.create!( key: 'db.at.cup.2012/13.2.version', value: '1' )
View
9 db/seeds/cl/2011_12/cl.rb
@@ -1,9 +0,0 @@
-# encoding: utf-8
-
-
-## note :team3 => false CL has no 3rd place (only final game)
-
-Event.find_by_key!( 'cl' ).update_attributes!( :team3 => false )
-
-
-Prop.create!( :key => 'db.cl.2011/12.2.version', :value => '1' )
View
6 db/seeds/cl/2011_12/el.rb
@@ -1,6 +0,0 @@
-# encoding: utf-8
-
-Event.find_by_key!( 'el' ).update_attributes!( :team3 => false )
-
-
-Prop.create!( :key => 'db.el.2011/12.2.version', :value => '1' )
View
9 db/seeds/cl/2012_13/cl.rb
@@ -1,9 +0,0 @@
-# encoding: utf-8
-
-
-## note :team3 => false CL has no 3rd place (only final game)
-
-Event.find_by_key!( 'cl.2012/13' ).update_attributes!( :team3 => false )
-
-
-Prop.create!( :key => 'db.cl.2012/13.2.version', :value => '1' )
View
4 db/seeds/cl/teams.rb
@@ -63,5 +63,5 @@
Team.update_image_from_ary!( teams )
-Prop.create!( :key => 'db.cl.teams.2.version', :value => '1' )
-Prop.create!( :key => 'db.el.teams.2.version', :value => '1' )
+Prop.create!( key: 'db.cl.teams.2.version', value: '1' )
+Prop.create!( key: 'db.el.teams.2.version', value: '1' )
View
7 db/seeds/cl/2012_13/cl_2.rb → db/seeds/cl/update.rb
@@ -1,7 +1,6 @@
# encoding: utf-8
-cl = Event.find_by_key!( 'cl.2012/13' )
-
+cl = Event.find_by_cl_2012_13!
porto = Team.find_by_key!( 'porto' )
kiew = Team.find_by_key!( 'kiew' )
@@ -46,9 +45,7 @@
clr2 = Round.find_by_event_id_and_pos!( cl.id, 2 )
-tipp3 = Service.find_by_key!( 'tipp3' )
-betathome = Service.find_by_key!( 'betathome' )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.cl.2012/13.2.version', :value => '1' )
+Prop.create!( key: 'db.cl.2012/13.2.version', value: '1' )
View
14 db/seeds/demo/users.rb
@@ -1,14 +0,0 @@
-# encoding: utf-8
-
-##############
-## Users
-
-User.create!( :name => 'Lionel MESSI', :email => 'lionel', :password => 'lionel' )
-User.create!( :name => 'Cristiano RONALDO', :email => 'cristiano', :password => 'cristiano' )
-
-User.create!( :name => 'Diego LAFATA', :email => 'demo', :password => 'demo' )
-
-User.create!( :name => 'Gerald BAUER', :email => 'gerald', :password => 'tipp', :admin => true )
-
-## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.demo.users.version', :value => '1' )
View
220 db/seeds/euro/2012.rb
@@ -1,10 +1,7 @@
# encoding: utf-8
-
-euro = Event.find_by_key!( 'euro' )
-euro.update_attributes!( :team3 => false )
-
+euro = Event.find_euro_2012!
##############################################
@@ -18,217 +15,4 @@
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.euro.2012.2.version', :value => '1' )
-
-
-
-### todo: split into its own file _quotes or _tipp3 etc.
-
-########################
-#
-# Add some quotes
-
-a1_pol_gre = Game.find_by_pos_and_round_id!( 1,euro_round1.id)
-a2_rus_cze = Game.find_by_pos_and_round_id!( 2,euro_round1.id)
-a9_gre_cze = Game.find_by_pos_and_round_id!( 9,euro_round2.id)
-a10_pol_rus = Game.find_by_pos_and_round_id!(10,euro_round2.id)
-a17_cze_pol = Game.find_by_pos_and_round_id!(17,euro_round3.id)
-a18_gre_rus = Game.find_by_pos_and_round_id!(18,euro_round3.id)
-
-b3_ned_den = Game.find_by_pos_and_round_id!( 3,euro_round1.id)
-b4_ger_por = Game.find_by_pos_and_round_id!( 4,euro_round1.id)
-b11_den_por = Game.find_by_pos_and_round_id!(11,euro_round2.id)
-b12_ned_ger = Game.find_by_pos_and_round_id!(12,euro_round2.id)
-b19_por_ned = Game.find_by_pos_and_round_id!(19,euro_round3.id)
-b20_den_ger = Game.find_by_pos_and_round_id!(20,euro_round3.id)
-
-c5_esp_ita = Game.find_by_pos_and_round_id!( 5,euro_round1.id)
-c6_irl_cro = Game.find_by_pos_and_round_id!( 6,euro_round1.id)
-c13_ita_cro = Game.find_by_pos_and_round_id!(13,euro_round2.id)
-c14_esp_irl = Game.find_by_pos_and_round_id!(14,euro_round2.id)
-c21_cro_esp = Game.find_by_pos_and_round_id!(21,euro_round3.id)
-c22_ita_irl = Game.find_by_pos_and_round_id!(22,euro_round3.id)
-
-d7_fra_eng = Game.find_by_pos_and_round_id!( 7,euro_round1.id)
-d8_ukr_swe = Game.find_by_pos_and_round_id!( 8,euro_round1.id)
-d15_swe_eng = Game.find_by_pos_and_round_id!(15,euro_round2.id)
-d16_ukr_fra = Game.find_by_pos_and_round_id!(16,euro_round2.id)
-d23_eng_ukr = Game.find_by_pos_and_round_id!(23,euro_round3.id)
-d24_swe_fra = Game.find_by_pos_and_round_id!(24,euro_round3.id)
-
-
-tipico = Service.find_by_key!( 'tipico' )
-betathome = Service.find_by_key!( 'betathome' )
-tipp3 = Service.find_by_key!( 'tipp3' )
-
-
-tipico_winner_odds = [ # tipico quotes 27/may
- [ esp, 3.6 ],
- [ ger, 4 ],
- [ ned, 8 ],
- [ fra, 12 ],
- [ eng, 12 ],
- [ ita, 15 ],
- [ por, 20 ],
- [ rus, 25 ],
- [ pol, 45 ],
- [ cro, 50 ],
- [ ukr, 50 ],
- [ swe, 60 ],
- [ gre, 70 ],
- [ cze, 70 ],
- [ den, 100 ],
- [ irl, 100 ]]
-
-EventQuote.create_from_ary!( tipico_winner_odds, tipico, euro )
-
-
-betathome_winner_odds = [
- [ esp, 3.5 ],
- [ ger, 3.9 ],
- [ ned, 7.5 ],
- [ eng, 10 ],
- [ fra, 15 ],
- [ ita, 15 ],
- [ por, 18 ],
- [ rus, 20 ],
- [ cro, 40 ],
- [ ukr, 40 ],
- [ cze, 50 ],
- [ gre, 50 ],
- [ pol, 50 ],
- [ swe, 65 ],
- [ den, 80 ],
- [ irl, 80 ]]
-
-EventQuote.create_from_ary!( betathome_winner_odds, betathome, euro )
-
-
-tipp3_winner_odds = [
- [ esp, 3.5 ],
- [ ger, 3.8 ],
- [ ned, 8 ],
- [ eng, 12 ],
- [ ita, 12 ],
- [ fra, 12 ],
- [ por, 20 ],
- [ rus, 25 ],
- [ cro, 50 ],
- [ ukr, 50 ],
- [ pol, 60 ],
- [ cze, 70 ],
- [ gre, 70 ],
- [ swe, 75 ],
- [ den, 90 ],
- [ irl, 90 ]]
-
-EventQuote.create_from_ary!( tipp3_winner_odds, tipp3, euro )
-
-tipp3_groupa_winner_odds = [
- [ rus, 2.3 ],
- [ pol, 3.4 ],
- [ cze, 4.5 ],
- [ gre, 5 ]]
-tipp3_groupb_winner_odds = [
- [ ger, 2.1 ],
- [ ned, 2.6 ],
- [ por, 4.5 ],
- [ den, 15 ]]
-tipp3_groupc_winner_odds = [
- [ esp, 1.45 ],
- [ ita, 4 ],
- [ cro, 6.5 ],
- [ irl, 18 ]]
-tipp3_groupd_winner_odds = [
- [ eng, 2.6 ],
- [ fra, 2.6 ],
- [ ukr, 5 ],
- [ swe, 6 ]]
-
-GroupQuote.create_from_ary!( tipp3_groupa_winner_odds, tipp3, euroa )
-GroupQuote.create_from_ary!( tipp3_groupb_winner_odds, tipp3, eurob )
-GroupQuote.create_from_ary!( tipp3_groupc_winner_odds, tipp3, euroc )
-GroupQuote.create_from_ary!( tipp3_groupd_winner_odds, tipp3, eurod )
-
-tipico_groupa_winner_odds = [
- [ rus, 2.5 ],
- [ pol, 3.6 ],
- [ cze, 4.7 ],
- [ gre, 5.5 ]]
-tipico_groupb_winner_odds = [
- [ ger, 2.05 ],
- [ ned, 2.9 ],
- [ por, 5 ],
- [ den, 20 ]]
-tipico_groupc_winner_odds = [
- [ esp, 1.55 ],
- [ ita, 4 ],
- [ cro, 8 ],
- [ irl, 18 ]]
-tipico_groupd_winner_odds = [
- [ fra, 2.6 ],
- [ eng, 2.7 ],
- [ ukr, 5.5 ],
- [ swe, 7 ]]
-
-GroupQuote.create_from_ary!( tipico_groupa_winner_odds, tipico, euroa )
-GroupQuote.create_from_ary!( tipico_groupb_winner_odds, tipico, eurob )
-GroupQuote.create_from_ary!( tipico_groupc_winner_odds, tipico, euroc )
-GroupQuote.create_from_ary!( tipico_groupd_winner_odds, tipico, eurod )
-
-
-tipp3_odds = [
- [ a1_pol_gre, 2, 2.9, 3.2 ],
- [ a2_rus_cze, 2.1, 2.9, 3 ],
- [ b3_ned_den, 1.55, 3.3, 4.9 ],
- [ b4_ger_por, 1.7, 3.1, 3.9 ],
- [ c5_esp_ita, 1.7, 3.1, 3.9 ],
- [ c6_irl_cro, 3.1, 2.9, 2.0 ],
- [ d7_fra_eng, 2.4, 2.9, 2.4 ],
- [ d8_ukr_swe, 2.2, 2.9, 2.8 ],
- [ a9_gre_cze, 2.6, 2.9, 2.3 ],
- [ a10_pol_rus, 2.7, 3, 2.2 ],
- [ b11_den_por, 3.5, 3.1, 1.8 ],
- [ b12_ned_ger, 2.8, 3, 2.2 ],
- [ c13_ita_cro, 2, 2.9, 3.3 ],
- [ c14_esp_irl, 1.3, 4.0, 7.4 ],
- [ d15_swe_eng, 3, 2.9, 2.1 ],
- [ d16_ukr_fra, 3.8, 3, 1.75 ],
- [ a17_cze_pol, 2.4, 2.9, 2.4 ],
- [ a18_gre_rus, 3.2, 3, 1.9 ],
- [ b19_por_ned, 3, 2.9, 2 ],
- [ b20_den_ger, 5.9, 3.4, 1.45 ],
- [ c21_cro_esp, 5.2, 3.4, 1.5 ],
- [ c22_ita_irl, 1.65, 3.1, 4.2 ],
- [ d23_eng_ukr, 2, 3, 3.1 ],
- [ d24_swe_fra, 3.3, 3, 1.9 ]]
-
-Quote.create_from_ary!( tipp3_odds, tipp3 )
-
-tipico_odds = [
- [ a1_pol_gre, 2, 3.3, 4 ],
- [ a2_rus_cze, 2.1, 3.3, 3.7 ],
- [ b3_ned_den, 1.6, 3.8, 6 ],
- [ b4_ger_por, 1.8, 3.5, 4.7 ],
- [ c5_esp_ita, 1.8, 3.5, 4.8 ],
- [ c6_irl_cro, 3.5, 3.3, 2.15 ],
- [ d7_fra_eng, 2.7, 3.2, 2.7 ],
- [ d8_ukr_swe, 2.3, 3.2, 3.4 ],
- [ a9_gre_cze, 3, 3.2, 2.5 ],
- [ a10_pol_rus, 3.1, 3.2, 2.4 ],
- [ b11_den_por, 4, 3.5, 1.95 ],
- [ b12_ned_ger, 3.3, 3.4, 2.25 ],
- [ c13_ita_cro, 2.1, 3.3, 3.7 ],
- [ c14_esp_irl, 1.3, 5, 12 ],
- [ d15_swe_eng, 4.3, 3.3, 1.95 ],
- [ d16_ukr_fra, 3.5, 3.2, 2.2 ],
- [ a17_cze_pol, 2.8, 3.3, 2.6 ],
- [ a18_gre_rus, 4, 3.4, 2 ],
- [ b19_por_ned, 7, 4.3, 1.5 ],
- [ b20_den_ger, 3.4, 3.4, 2.2 ],
- [ c21_cro_esp, 6.5, 4, 1.55 ],
- [ c22_ita_irl, 1.75, 3.6, 5 ],
- [ d23_eng_ukr, 2.15, 3.3, 3.6 ],
- [ d24_swe_fra, 3.7, 3.3, 2.1 ]]
-
-Quote.create_from_ary!( tipico_odds, tipico )
+Prop.create!( key: 'db.euro.2012.2.version', value: '1' )
View
2 db/seeds/euro/2012_calc.rb
@@ -3,7 +3,7 @@
# note: timezone for games (play_at) is *always* CET (central european time)
-euro = Event.find_by_key!( 'euro' )
+euro = Event.find_euro_2012!
##############################################
## Fix (Calc) Rounds for **Fix** Style Pool
View
2 db/seeds/euro/teams.rb
@@ -27,4 +27,4 @@
Team.update_image_from_ary!( teams )
-Prop.create!( :key => 'db.euro.teams.2.version', :value => '1' )
+Prop.create!( key: 'db.euro.teams.2.version', value: '1' )
View
2 db/seeds/mx/apertura_2012.rb
@@ -1,2 +0,0 @@
-
-## nothing here
View
2 db/seeds/mx/teams.rb
@@ -27,4 +27,4 @@
Team.update_image_from_ary!( teams )
-Prop.create!( :key => 'db.mx.teams.2.version', :value => '1' )
+Prop.create!( key: 'db.mx.teams.2.version', value: '1' )
View
2 db/seeds/nhl/teams.rb
@@ -43,4 +43,4 @@
Team.update_image_from_ary!( teams )
-Prop.create!( :key => 'db.nhl.teams.2.version', :value => '1' )
+Prop.create!( key: 'db.nhl.teams.2.version', value: '1' )
View
2 db/seeds/ro/l1_2012_13.rb
@@ -1,2 +0,0 @@
-## nothing here
-
View
2 db/seeds/ro/teams.rb
@@ -24,4 +24,4 @@
Team.update_image_from_ary!( l1 )
-Prop.create!( :key => 'db.ro.teams.2.version', :value => '1' )
+Prop.create!( key: 'db.ro.teams.2.version', value: '1' )
View
10 db/seeds/demo/pools.rb → db/seeds/setups/demo/pools.rb
@@ -6,22 +6,22 @@
demo = User.find_by_key!( 'demo' )
-wmql = Event.find_by_key!( 'wmql' )
+wmq = Event.find_by_key!( 'wmq.euro' )
-pool1 = Pool.create!( :event => wmql, :title => 'Demo', :user => lionel, :welcome => '' )
+pool1 = Pool.create!( event: wmq, title: 'Demo', user: lionel, welcome: '' )
pool1.players << lionel # also auto add admin as first player
pool1.players << demo
-cl = Event.find_by_key!( 'cl.2012/13' )
+cl = Event.find_cl_2012_13!
-pool2 = Pool.create!( :event => cl, :title => 'Demo', :user => cristiano, :welcome => '' )
+pool2 = Pool.create!( event: cl, title: 'Demo', user: cristiano, welcome: '' )
pool2.players << cristiano
pool2.players << demo
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.demo.pools.version', :value => '1' )
+Prop.create!( key: 'db.demo.pools.version', value: '1' )
View
14 db/seeds/setups/demo/users.rb
@@ -0,0 +1,14 @@
+# encoding: utf-8
+
+##############
+## Users
+
+User.create!( name: 'Lionel MESSI', email: 'lionel', password: 'lionel' )
+User.create!( name: 'Cristiano RONALDO', email: 'cristiano', password: 'cristiano' )
+
+User.create!( name: 'Diego LAFATA', email: 'demo', password: 'demo' )
+
+User.create!( name: 'Gerald BAUER', email: 'gerald', password: 'tipp', admin: true )
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( key: 'db.demo.users.version', value: '1' )
View
34 db/seeds/setups/uss/euro/bonus.rb
@@ -0,0 +1,34 @@
+
+puts "*** loading seed data in seeds/uss/euro_bonus.rb"
+
+
+nn = User.find_by_key!( 'nn' )
+
+euro = Event.find_euro_2012!
+
+poolfix = Pool.find_by_event_id_and_user_id_and_fix!( euro.id, nn.id, true )
+poolflex = Pool.find_by_event_id_and_user_id_and_fix!( euro.id, nn.id, false )
+
+rfix1 = BonusRound.create!( pool_id: poolfix.id, pos: 1, title: 'Bonuspunkte - Gruppenplazierung' )
+rfix2 = BonusRound.create!( pool_id: poolfix.id, pos: 2, title: 'Bonuspunkte - Europa- und Vizemeister' )
+
+qfix1 = BonusQuestion.create!( round_id: rfix1.id, pos: 1, title: 'Gruppenerster? Gruppenzweiter? Grupperdritter? Gruppenvierter?' )
+qfix2 = BonusQuestion.create!( round_id: rfix2.id, pos: 1, title: 'Europameister? Vizemeister?' )
+
+
+rflex1 = BonusRound.create!( pool_id: poolflex.id, pos: 1, title: 'Bonuspunkte - Europa- und Vizemeister' )
+qflex1 = BonusQuestion.create!( round_id: rflex1.id, pos: 1, title: 'Europameister? Vizemeister?' )
+
+poolfix.players.each do |player|
+ [qfix1,qfix2].each do |question|
+ BonusTip.create!( question_id: question.id, user_id: player.id )
+ end
+end
+
+poolflex.players.each do |player|
+ [qflex1].each do |question|
+ BonusTip.create!( question_id: question.id, user_id: player.id )
+ end
+end
+
+Prop.create!( key: 'db.uss.euro.bonus.version', value: '1' )
View
2 db/seeds/uss/euro_bonus2.rb → db/seeds/setups/uss/euro/bonus2.rb
@@ -36,4 +36,4 @@
tip.save!
end
-Prop.create!( :key => 'db.seeds.uss.euro.bonus2.version', :value => '1' )
+Prop.create!( key: 'db.uss.euro.bonus2.version', value: '1' )
View
0 db/seeds/uss/euro_data.txt → db/seeds/setups/uss/euro/data.txt
File renamed without changes.
View
0 db/seeds/uss/euro_pools.rb → db/seeds/setups/uss/euro/pools.rb
File renamed without changes.
View
0 db/seeds/uss/others_data.txt → db/seeds/setups/uss/others_data.txt
File renamed without changes.
View
26 db/seeds/setups/uss/others_pools.rb
@@ -0,0 +1,26 @@
+# encoding: utf-8
+
+##############
+## Pools
+
+at_bl = Event.find_at_2012_13!
+at_cup = Event.find_at_cup_2012_13!
+cl = Event.find_cl_2012_13!
+wm_quali = Event.find_by_key!( 'wmq.euro' )
+
+nn = User.find_by_key!( 'nn' )
+
+behrooz = User.find_by_key!( 'behroozs' )
+manfred = User.find_by_key!( 'manfredk' )
+ande = User.find_by_key!( 'ande' )
+
+
+Pool.create!( event: at_bl, title: 'USS', user: manfred, welcome: '' )
+Pool.create!( event: at_cup, title: 'USS', user: manfred, welcome: '' )
+Pool.create!( event: wm_quali, title: 'USS', user: behrooz, welcome: '' )
+Pool.create!( event: cl, title: 'USS', user: ande, welcome: '' )
+
+
+
+## todo: use new version constant for app module e.g. Wettpool::VERSION ??
+Prop.create!( key: 'db.uss.pools.others.version', value: '1' )
View
2 db/seeds/uss/others_pools2.rb → db/seeds/setups/uss/others_pools2.rb
@@ -7,4 +7,4 @@
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.uss.pools.others.2.version', :value => '1' )
+Prop.create!( key: 'db.uss.pools.others.2.version', value: '1' )
View
2 db/seeds/uss/users.rb → db/seeds/setups/uss/users.rb
@@ -46,4 +46,4 @@
User.create_from_ary!( users )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.uss.users.version', :value => '1' )
+Prop.create!( key: 'db.uss.users.version', value: '1' )
View
4 db/seeds/ussr/pools.rb → db/seeds/setups/ussr/pools.rb
@@ -9,7 +9,7 @@
aurel = User.find_by_key!( 'aurel' )
-Pool.create!( :event => ro_l1, :title => 'USS', :user => aurel, :welcome => '' )
+Pool.create!( event: ro_l1, title: 'USSR', user: aurel, welcome: '' )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.ussr.pools.others.version', :value => '1' )
+Prop.create!( key: 'db.ussr.pools.others.version', value: '1' )
View
2 db/seeds/ussr/users.rb → db/seeds/setups/ussr/users.rb
@@ -27,4 +27,4 @@
User.create_from_ary!( users )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.ussr.users.version', :value => '1' )
+Prop.create!( key: 'db.seeds.ussr.users.version', value: '1' )
View
34 db/seeds/uss/euro_bonus.rb
@@ -1,34 +0,0 @@
-
-puts "*** loading seed data in seeds/uss/euro_bonus.rb"
-
-
-nn = User.find_by_key!( 'nn' )
-
-euro = Event.find_by_key!( 'euro')
-
-poolfix = Pool.find_by_event_id_and_user_id_and_fix!( euro.id, nn.id, true )
-poolflex = Pool.find_by_event_id_and_user_id_and_fix!( euro.id, nn.id, false )
-
-rfix1 = BonusRound.create!( :pool_id => poolfix.id, :pos => 1, :title => 'Bonuspunkte - Gruppenplazierung' )
-rfix2 = BonusRound.create!( :pool_id => poolfix.id, :pos => 2, :title => 'Bonuspunkte - Europa- und Vizemeister' )
-
-qfix1 = BonusQuestion.create!( :round_id => rfix1.id, :pos => 1, :title => 'Gruppenerster? Gruppenzweiter? Grupperdritter? Gruppenvierter?' )
-qfix2 = BonusQuestion.create!( :round_id => rfix2.id, :pos => 1, :title => 'Europameister? Vizemeister?' )
-
-
-rflex1 = BonusRound.create!( :pool_id => poolflex.id, :pos => 1, :title => 'Bonuspunkte - Europa- und Vizemeister' )
-qflex1 = BonusQuestion.create!( :round_id => rflex1.id, :pos => 1, :title => 'Europameister? Vizemeister?' )
-
-poolfix.players.each do |player|
- [qfix1,qfix2].each do |question|
- BonusTip.create!( :question_id => question.id, :user_id => player.id )
- end
-end
-
-poolflex.players.each do |player|
- [qflex1].each do |question|
- BonusTip.create!( :question_id => question.id, :user_id => player.id )
- end
-end
-
-Prop.create!( :key => 'db.seeds.uss.euro.bonus.version', :value => '1' )
View
26 db/seeds/uss/others_pools.rb
@@ -1,26 +0,0 @@
-# encoding: utf-8
-
-##############
-## Pools
-
-at_bl = Event.find_by_key!( 'at_bl_2012_13' )
-at_cup = Event.find_by_key!( 'at_cup_2012_13' )
-wm_quali = Event.find_by_key!( 'wmq' )
-cl_2012_13 = Event.find_by_key!( 'cl.2012/13' )
-
-nn = User.find_by_key!( 'nn' )
-
-behrooz = User.find_by_key!( 'behroozs' )
-manfred = User.find_by_key!( 'manfredk' )
-ande = User.find_by_key!( 'ande' )
-
-
-Pool.create!( :event => at_bl, :title => 'USS', :user => manfred, :welcome => '' )
-Pool.create!( :event => at_cup, :title => 'USS', :user => manfred, :welcome => '' )
-Pool.create!( :event => wm_quali, :title => 'USS', :user => behrooz, :welcome => '' )
-Pool.create!( :event => cl_2012_13, :title => 'USS', :user => ande, :welcome => '' )
-
-
-
-## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.uss.pools.others.version', :value => '1' )
View
2 db/seeds/world/quali_2012_13.rb
@@ -1,2 +0,0 @@
-# nothing here
-
View
8 db/seeds/world/quali_2012_13_2.rb → db/seeds/world/update.rb
@@ -11,14 +11,10 @@
swe = Team.find_by_key!( 'swe' )
-world = Event.find_by_key!( 'wmql' )
-
-
-tipp3 = Service.find_by_key!( 'tipp3' )
-betathome = Service.find_by_key!( 'betathome' )
+world = Event.find_by_key!( 'wmq.euro' )
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
-Prop.create!( :key => 'db.seeds.world.quali.2012/13.2.version', :value => '1' )
+Prop.create!( key: 'db.world.quali.2012/13.2.version', value: '1' )

0 comments on commit 6a38d84

Please sign in to comment.