summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/games_controller.rb2
-rw-r--r--app/controllers/tournaments_controller.rb2
-rw-r--r--app/views/games/_form.html.erb4
-rw-r--r--app/views/games/index.html.erb2
-rw-r--r--app/views/games/index.json.jbuilder2
-rw-r--r--app/views/games/show.html.erb5
-rw-r--r--app/views/games/show.json.jbuilder2
-rw-r--r--app/views/tournaments/_form.html.erb6
-rw-r--r--app/views/tournaments/index.json.jbuilder2
-rw-r--r--app/views/tournaments/show.html.erb4
-rw-r--r--app/views/tournaments/show.json.jbuilder2
11 files changed, 8 insertions, 25 deletions
diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb
index 3ccd7be..d014a1c 100644
--- a/app/controllers/games_controller.rb
+++ b/app/controllers/games_controller.rb
@@ -67,6 +67,6 @@ class GamesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def game_params
- params.require(:game).permit(:parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method)
+ params.require(:game).permit(:parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :scoring_method)
end
end
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index c06c16c..0947ac8 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -184,7 +184,7 @@ class TournamentsController < ApplicationController
def tournament_attribute_params
params[:num_stages] ||= 1
if params[:tournament]
- p = params.require(:tournament).permit(:game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method)
+ p = params.require(:tournament).permit(:game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :scoring_method)
if p[:game_id]
game = Game.find(p[:game_id])
p[:min_players_per_team] ||= game.min_players_per_team
diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb
index e7def85..f796f87 100644
--- a/app/views/games/_form.html.erb
+++ b/app/views/games/_form.html.erb
@@ -36,10 +36,6 @@
<%= f.number_field :max_teams_per_match %>
</div>
<div class="field">
- <%= f.label :sampling_method %><br>
- <%= f.text_field :sampling_method %>
- </div>
- <div class="field">
<%= f.label :scoring_method %><br>
<%= f.text_field :scoring_method %>
</div>
diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb
index 565320c..f12253c 100644
--- a/app/views/games/index.html.erb
+++ b/app/views/games/index.html.erb
@@ -9,7 +9,6 @@
<th>Max players per team</th>
<th>Min teams per match</th>
<th>Max teams per match</th>
- <th>Sampling method</th>
<th>Scoring method</th>
<th></th>
<th></th>
@@ -26,7 +25,6 @@
<td><%= game.max_players_per_team %></td>
<td><%= game.min_teams_per_match %></td>
<td><%= game.max_teams_per_match %></td>
- <td><%= game.sampling_method %></td>
<td><%= game.scoring_method %></td>
<td><%= link_to 'Show', game %></td>
<td><%= link_to 'Edit', edit_game_path(game) %></td>
diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder
index 0e9769b..d196201 100644
--- a/app/views/games/index.json.jbuilder
+++ b/app/views/games/index.json.jbuilder
@@ -1,4 +1,4 @@
json.array!(@games) do |game|
- json.extract! game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method
+ json.extract! game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :scoring_method
json.url game_url(game, format: :json)
end
diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb
index 4c67493..6184784 100644
--- a/app/views/games/show.html.erb
+++ b/app/views/games/show.html.erb
@@ -29,11 +29,6 @@
</p>
<p>
- <strong>Sampling method:</strong>
- <%= @game.sampling_method %>
-</p>
-
-<p>
<strong>Scoring method:</strong>
<%= @game.scoring_method %>
</p>
diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder
index 981c31e..9a0dab6 100644
--- a/app/views/games/show.json.jbuilder
+++ b/app/views/games/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method, :created_at, :updated_at
+json.extract! @game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :scoring_method, :created_at, :updated_at
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb
index a5eba7a..38f01ee 100644
--- a/app/views/tournaments/_form.html.erb
+++ b/app/views/tournaments/_form.html.erb
@@ -57,12 +57,6 @@
<%= f.label :scoring_method %>
<%= f.select(:scoring_method, @tournament.scoring_methods.map{|method| [method.humanize.titleize, method]}) %>
</p>
-
- <p>
- <%= f.label :sampling_method %>
- <%= f.select(:sampling_method, @tournament.sampling_methods.map{|method| [method.humanize, method]}) %>
- </p>
-
</fieldset>
<fieldset>
diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder
index c6b9e68..f92397f 100644
--- a/app/views/tournaments/index.json.jbuilder
+++ b/app/views/tournaments/index.json.jbuilder
@@ -1,4 +1,4 @@
json.array!(@tournaments) do |tournament|
- json.extract! tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method
+ json.extract! tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :scoring_method
json.url tournament_url(tournament, format: :json)
end
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index c71d3c6..ec83dc0 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -46,8 +46,8 @@
</p>
<p>
- <strong>Sampling method:</strong>
- <%= @tournament.sampling_method.humanize.capitalize %>
+ <strong>Scoring method:</strong>
+ <%= @tournament.scoring_method.titleize %>
</p>
<% @tournament.settings.each do |setting| %>
diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder
index afc5814..888c6b2 100644
--- a/app/views/tournaments/show.json.jbuilder
+++ b/app/views/tournaments/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method, :created_at, :updated_at
+json.extract! @tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :scoring_method, :created_at, :updated_at