summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-27 20:24:44 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-27 20:24:44 -0400
commitdedb63d770af24eee6e73289499ba22ec607cbf2 (patch)
tree25983f71a28b5e92b004c13ede032d45daec94f3
parentb8ce4ab9ad7e6359080e894958a3181cbb3895d2 (diff)
clean up seeds.rb
-rw-r--r--db/seeds.rb69
1 files changed, 35 insertions, 34 deletions
diff --git a/db/seeds.rb b/db/seeds.rb
index dc95929..c37dcf7 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -10,19 +10,19 @@ p = User.permission_bits
Server.create(default_user_permissions: p[:join_tournament] | p[:create_pm] | p[:edit_pm] | p[:create_bracket])
league = Game.create(name: "League of Legends", min_players_per_team: 5, max_players_per_team: 5, min_teams_per_match: 2, max_teams_per_match: 2, sampling_method: "riot_api")
-league.settings.create(display_order: 1, name: "Map" , description: "Select a map to play on.", vartype: GameSetting::types[:pick_one_dropdown], type_opt: "Summoners Rift,Twisted Treeline,Crystal Scar,Haunted Abyss", default: "Summoners Rift")
-league.settings.create(display_order: 2, name: "Pick type", description: "Select a pick type." , vartype: GameSetting::types[:pick_one_dropdown], type_opt: "Blind pick,Draft" , default: "Draft")
+league.settings.create(display_order: 1, name: "map" , description: "Select a map to play on.", vartype: GameSetting::types[:pick_one_dropdown], type_opt: "summoners_rift,twisted_treeline,crystal_scar,haunted_abyss", default: "summoners_rift")
+league.settings.create(display_order: 2, name: "pick_type", description: "Select a pick type." , vartype: GameSetting::types[:pick_one_dropdown], type_opt: "blind_pick,draft" , default: "draft")
-chess = Game.create(name: "Chess", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, sampling_method: "Manual,Double Blind")
-chess.settings.create(display_order: 1, name: "Time Control", description: "Enter a value for Time Control (ie. 5-5, 30, 6hr, or None)", vartype: GameSetting::types[:text_short], default: "")
+chess = Game.create(name: "Chess", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, sampling_method: "double_blind")
+chess.settings.create(display_order: 1, name: "time_control", description: "Enter a value for Time Control (ie. 5-5, 30, 6hr, or None)", vartype: GameSetting::types[:text_short], default: "")
-hearthstone = Game.create(name: "Hearthstone", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, sampling_method: "Manual,Double Blind")
-hearthstone.settings.create(display_order: 1, name: "Deck name", description: "Enter a name for your deck, be descriptive.", vartype: GameSetting::types[:text_long], default: "")
+hearthstone = Game.create(name: "Hearthstone", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, sampling_method: "double_blind")
+hearthstone.settings.create(display_order: 1, name: "deck_name", description: "Enter a name for your deck, be descriptive.", vartype: GameSetting::types[:text_long], default: "")
-rockpaperscissors = Game.create(name: "Rock, Paper, Scissors", min_players_per_team: 1, max_players_per_team: 3, min_teams_per_match: 2, max_teams_per_match: 2, sampling_method: "Manual,Double Blind")
-rockpaperscissors.settings.create(display_order: 4, name: "Lizard/Spock allowed?", description: "Will you allow Lizard and Spock?" , vartype: GameSetting::types[:true_false] , default: false)
-rockpaperscissors.settings.create(display_order: 5, name: "Favorite object" , description: "What is your favorite object in RPS?", vartype: GameSetting::types[:pick_one_radio], type_opt: "Rock,Paper,Scissors", default: "Rock")
-rockpaperscissors.settings.create(display_order: 6, name: "Check boxes" , description: "Example boxes" , vartype: GameSetting::types[:pick_several] , type_opt: "I do not know,There is now spoon,Wow,Because electricity,Wat?", default: "Wow,Wat?")
+rockpaperscissors = Game.create(name: "Rock, Paper, Scissors", min_players_per_team: 1, max_players_per_team: 3, min_teams_per_match: 2, max_teams_per_match: 2, sampling_method: "double_blind")
+rockpaperscissors.settings.create(display_order: 4, name: "lizard_spock_allowed", description: "Will you allow Lizard and Spock?" , vartype: GameSetting::types[:true_false] , default: false)
+rockpaperscissors.settings.create(display_order: 5, name: "favorite_object" , description: "What is your favorite object in RPS?", vartype: GameSetting::types[:pick_one_radio], type_opt: "rock,paper,scissors", default: "rock")
+rockpaperscissors.settings.create(display_order: 6, name: "check_boxes" , description: "Example boxes" , vartype: GameSetting::types[:pick_several] , type_opt: "i_do_not_know,there_is_now_spoon,wow,because_electricity,wat?", default: "wow,wat?")
if Rails.env.development?
#user 1, the ADMIN
@@ -43,35 +43,36 @@ if Rails.env.development?
players_for_league = Array.new
#users for our fake seeded game from the yamls
- players_for_league.push(User.create(name: "Sytrie", password: "password", email: "Sytrie@gmail.com", user_name: "Sytrie", password_confirmation: "password"))
- players_for_league.push(User.create(name: "Derpanator115", password: "password", email: "Derpanator115@gmail.com", user_name: "Derpanator115", password_confirmation: "password"))
- players_for_league.push(User.create(name: "Wlknexe56", password: "password", email: "Wlknexe56@gmail.com", user_name: "Wlknexe56", password_confirmation: "password"))
- players_for_league.push(User.create(name: "DVisionzz", password: "password", email: "DVisionzz@gmail.com", user_name: "DVisionzz", password_confirmation: "password"))
- players_for_league.push(User.create(name: "HYP3RTONIC", password: "password", email: "HYP3RTONIC@gmail.com", user_name: "HYP3RTONIC", password_confirmation: "password"))
- players_for_league.push(User.create(name: "M9Fumjaa", password: "password", email: "M9Fumjaa@gmail.com", user_name: "M9Fumjaa", password_confirmation: "password"))
- players_for_league.push(User.create(name: "spikevsnaruto", password: "password", email: "spikevsnaruto@gmail.com", user_name: "spikevsnaruto", password_confirmation: "password"))
- players_for_league.push(User.create(name: "GoogleMaSkills", password: "password", email: "GoogleMaSkills@gmail.com", user_name: "GoogleMaSkills", password_confirmation: "password"))
+ players_for_league.push(User.create(name: "Sytrie" , password: "password", email: "Sytrie@gmail.com" , user_name: "Sytrie" , password_confirmation: "password"))
+ players_for_league.push(User.create(name: "Derpanator115" , password: "password", email: "Derpanator115@gmail.com" , user_name: "Derpanator115" , password_confirmation: "password"))
+ players_for_league.push(User.create(name: "Wlknexe56" , password: "password", email: "Wlknexe56@gmail.com" , user_name: "Wlknexe56" , password_confirmation: "password"))
+ players_for_league.push(User.create(name: "DVisionzz" , password: "password", email: "DVisionzz@gmail.com" , user_name: "DVisionzz" , password_confirmation: "password"))
+ players_for_league.push(User.create(name: "HYP3RTONIC" , password: "password", email: "HYP3RTONIC@gmail.com" , user_name: "HYP3RTONIC" , password_confirmation: "password"))
+ players_for_league.push(User.create(name: "M9Fumjaa" , password: "password", email: "M9Fumjaa@gmail.com" , user_name: "M9Fumjaa" , password_confirmation: "password"))
+ players_for_league.push(User.create(name: "spikevsnaruto" , password: "password", email: "spikevsnaruto@gmail.com" , user_name: "spikevsnaruto" , password_confirmation: "password"))
+ players_for_league.push(User.create(name: "GoogleMaSkills" , password: "password", email: "GoogleMaSkills@gmail.com" , user_name: "GoogleMaSkills" , password_confirmation: "password"))
players_for_league.push(User.create(name: "james chamberlan", password: "password", email: "jameschamberlan@gmail.com", user_name: "james chamberlan", password_confirmation: "password"))
- players_for_league.push(User.create(name: "Kaceytron", password: "password", email: "Kaceytron@gmail.com", user_name: "Kaceytron", password_confirmation: "password"))
+ players_for_league.push(User.create(name: "Kaceytron" , password: "password", email: "Kaceytron@gmail.com" , user_name: "Kaceytron" , password_confirmation: "password"))
#semi-real users
- davis = User.create(name: "Davis Webb", password: "password", email: "davislwebb@gmail.com", user_name: "TeslasMind", password_confirmation: "password")
- foy = User.create(name: "Nathaniel Foy", password: "password", email: "nfoy@notreal.com", user_name: "Nalfeinx", password_confirmation: "password")
- guntas = User.create(name: "Guntas Grewal", password: "password", email: "guntasgrewal@gmail.com", user_name: "guntasgrewal", password_confirmation: "password")
- luke = User.create(name: "Luke Shumaker", password: "password", email: "lukeshu@emacs4lyfe.com", user_name: "lukeshu", password_confirmation: "password")
- tomer = User.create(name: "Tomer Kimia", password: "password", email: "tomer@2majors4lyfe.com", user_name: "tkimia", password_confirmation: "password")
- andrew = User.create(name: "Andrew Murrell", password: "password", email: "murrel@murrel.gov", user_name: "ImFromNasa", password_confirmation: "password")
- joey = User.create(name: "Joseph Adams", password: "password", email: "alpha142@fluttershyop.com", user_name: "alpha142", password_confirmation: "password")
- josh = User.create(name: "Josh Huser", password: "password", email: "jhuser@iownabusiness.net", user_name: "WinterWorks", password_confirmation: "password")
- dunsmore = User.create(name: "Professor Dunsmore", password: "password", email: "bxd@purdue.edu", user_name: "Dumbledore", password_confirmation: "password")
- marco = User.create(name: "Marco Polo", password: "password", email: "marco@ta4lyfe.com", user_name: "iCoordinate", password_confirmation: "password")
- jordan = User.create(name: "Geoffrey Webb", password: "password", email: "imnotjoffreybarathian@gameofthrones.com", user_name: "GTBPhoenix", password_confirmation: "password")
- obama = User.create(name: "Obama", password: "password", email: "obama@whitehouse.gov", user_name: "Obama", password_confirmation: "password")
-
+ davis = User.create(name: "Davis Webb" , password: "password", email: "davislwebb@gmail.com" , user_name: "TeslasMind" , password_confirmation: "password")
+ foy = User.create(name: "Nathaniel Foy" , password: "password", email: "nfoy@notreal.com" , user_name: "Nalfeinx" , password_confirmation: "password")
+ guntas = User.create(name: "Guntas Grewal" , password: "password", email: "guntasgrewal@gmail.com" , user_name: "guntasgrewal", password_confirmation: "password")
+ luke = User.create(name: "Luke Shumaker" , password: "password", email: "lukeshu@emacs4lyfe.com" , user_name: "lukeshu" , password_confirmation: "password")
+ tomer = User.create(name: "Tomer Kimia" , password: "password", email: "tomer@2majors4lyfe.com" , user_name: "tkimia" , password_confirmation: "password")
+ andrew = User.create(name: "Andrew Murrell" , password: "password", email: "murrel@murrel.gov" , user_name: "ImFromNasa" , password_confirmation: "password")
+ joey = User.create(name: "Joseph Adams" , password: "password", email: "alpha142@fluttershyop.com" , user_name: "alpha142" , password_confirmation: "password")
+ josh = User.create(name: "Josh Huser" , password: "password", email: "jhuser@iownabusiness.net" , user_name: "WinterWorks" , password_confirmation: "password")
+ dunsmore = User.create(name: "Professor Dunsmore", password: "password", email: "bxd@purdue.edu" , user_name: "Dumbledore" , password_confirmation: "password")
+ marco = User.create(name: "Marco Polo" , password: "password", email: "marco@ta4lyfe.com" , user_name: "iCoordinate" , password_confirmation: "password")
+ jordan = User.create(name: "Geoffrey Webb" , password: "password", email: "imnotjoffreybarathian@gameofthrones.com", user_name: "GTBPhoenix" , password_confirmation: "password")
+ obama = User.create(name: "Obama" , password: "password", email: "obama@whitehouse.gov" , user_name: "Obama" , password_confirmation: "password")
#league of legends tournament
- league_tourn = Tournament.create(game_id: 1, status: 0, name: "League of Legends Seed", min_players_per_team: 5, max_players_per_team: 5, min_teams_per_match: 2,
- max_teams_per_match: 2, sampling_method: nil)
+ league_tourn = Tournament.create(game: league, status: 0, name: "League of Legends Seed",
+ min_players_per_team: 5, max_players_per_team: 5,
+ min_teams_per_match: 2, max_teams_per_match: 2,
+ sampling_method: "riot_api", scoring_method: "TODO")
#adds players to the seeded league tournament
for i in 0..9