summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-23 12:54:11 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-23 12:54:11 -0400
commitb6d146624b6d3e78c24d3bade5eb558f0a9f626b (patch)
treed77bb48d8d09b5e0880b2ad33f957f88f4b43b81
parentc846cd71411ec3373a5229cacafe0df6b3673543 (diff)
Removed whitespace, added support for sampling_methods in view, modified seeds
-rw-r--r--app/models/game.rb2
-rw-r--r--app/views/tournaments/_selected.html.erb6
-rw-r--r--db/seeds.rb8
3 files changed, 10 insertions, 6 deletions
diff --git a/app/models/game.rb b/app/models/game.rb
index ec865d8..345877e 100644
--- a/app/models/game.rb
+++ b/app/models/game.rb
@@ -1,3 +1,3 @@
class Game < ActiveRecord::Base
- has_many :settings, class_name: "GameSetting"
+ has_many :settings, class_name: "GameSetting"
end
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb
index a4efa4f..7f0cf81 100644
--- a/app/views/tournaments/_selected.html.erb
+++ b/app/views/tournaments/_selected.html.erb
@@ -9,8 +9,12 @@
<% end %>
<p>
<%= f.label name %><br>
- <% if !@game.attributes[name].nil? %>
+ <% unless @game.attributes[name].nil? %>
+ <% if name == "sampling_method" %>
+ <%= f.select( name, @game.sampling_method.split(',') ) %>
+ <% else %>
<%= f.text_field(name, :value => @game.attributes[name] ) %>
+ <% end %>
<% else %>
<%= f.text_field name %>
<% end %>
diff --git a/db/seeds.rb b/db/seeds.rb
index ea01c78..b8c40df 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -9,10 +9,10 @@
p = User.permission_bits
Server.create(default_user_permissions: p[:join_tournament] | p[:create_pm])
-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, set_rounds: nil, randomized_teams: true)
-Game.create(name: "Chess", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, set_rounds: nil, randomized_teams: true)
-Game.create(name: "Hearthstone", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, set_rounds: 1, randomized_teams: false)
-Game.create(name: "Rock, Paper, Scissors", min_players_per_team: 1, max_players_per_team: 3, min_teams_per_match: 1, max_teams_per_match: nil, set_rounds: nil, randomized_teams: false)
+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, set_rounds: nil, randomized_teams: true, sampling_method: "Manual,Double Blind,RiotAPI")
+Game.create(name: "Chess", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, set_rounds: nil, randomized_teams: true, sampling_method: "Manual,Double Blind")
+Game.create(name: "Hearthstone", min_players_per_team: 1, max_players_per_team: 1, min_teams_per_match: 2, max_teams_per_match: 2, set_rounds: 1, randomized_teams: false, sampling_method: "Manual,Double Blind")
+Game.create(name: "Rock, Paper, Scissors", min_players_per_team: 1, max_players_per_team: 3, min_teams_per_match: 1, max_teams_per_match: nil, set_rounds: nil, randomized_teams: false, sampling_method: "Manual,Double Blind")
Game.find_by_name("League of Legends").settings.create(name: "Map", default: "Summoners Rift", type_opt: "Summoners Rift,Twisted Treeline,Crystal Scar,Haunted Abyss", description: "Select a map to play on.", vartype: 5, display_order: 1)
Game.find_by_name("League of Legends").settings.create(name: "Pick Type", type_opt: "Blind Pick,Draft", description: "Select a pick type.", vartype: 5, display_order: 2)