From 0f2b05889cba090e4824f62965ee8d131da09973 Mon Sep 17 00:00:00 2001
From: AndrewMurrell
Date: Tue, 1 Apr 2014 17:07:46 -0400
Subject: Re-ran generate.
---
app/controllers/matches_controller.rb | 2 +-
app/controllers/tournaments_controller.rb | 2 +-
app/models/remote_username.rb | 4 ++++
app/models/server_setting.rb | 2 ++
app/models/server_settings.rb | 2 --
app/models/tournament_option.rb | 3 ---
app/models/tournament_preference.rb | 3 +++
app/views/matches/_form.html.erb | 4 ++++
app/views/matches/index.html.erb | 2 ++
app/views/matches/index.json.jbuilder | 2 +-
app/views/matches/show.html.erb | 5 +++++
app/views/matches/show.json.jbuilder | 2 +-
app/views/tournaments/_form.html.erb | 20 ++------------------
app/views/tournaments/index.html.erb | 12 ++----------
app/views/tournaments/index.json.jbuilder | 2 +-
app/views/tournaments/show.html.erb | 24 ++----------------------
app/views/tournaments/show.json.jbuilder | 2 +-
17 files changed, 32 insertions(+), 61 deletions(-)
create mode 100644 app/models/remote_username.rb
create mode 100644 app/models/server_setting.rb
delete mode 100644 app/models/server_settings.rb
delete mode 100644 app/models/tournament_option.rb
create mode 100644 app/models/tournament_preference.rb
(limited to 'app')
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index d79a7fc..64414cf 100644
--- a/app/controllers/matches_controller.rb
+++ b/app/controllers/matches_controller.rb
@@ -69,6 +69,6 @@ class MatchesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def match_params
- params.require(:match).permit(:status, :tournament_id, :name, :winner_id)
+ params.require(:match).permit(:status, :tournament_id, :name, :winner_id, :remote_id)
end
end
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index d7db632..2565577 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -69,6 +69,6 @@ class TournamentsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def tournament_params
- params.require(:tournament).permit(:name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams)
+ params.require(:tournament).permit(:name, :game_id, :status, :ger, :randomized_teams)
end
end
diff --git a/app/models/remote_username.rb b/app/models/remote_username.rb
new file mode 100644
index 0000000..94e5063
--- /dev/null
+++ b/app/models/remote_username.rb
@@ -0,0 +1,4 @@
+class RemoteUsername < ActiveRecord::Base
+ belongs_to :game
+ belongs_to :user
+end
diff --git a/app/models/server_setting.rb b/app/models/server_setting.rb
new file mode 100644
index 0000000..28ae943
--- /dev/null
+++ b/app/models/server_setting.rb
@@ -0,0 +1,2 @@
+class ServerSetting < ActiveRecord::Base
+end
diff --git a/app/models/server_settings.rb b/app/models/server_settings.rb
deleted file mode 100644
index 7f49863..0000000
--- a/app/models/server_settings.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-class ServerSettings < ActiveRecord::Base
-end
diff --git a/app/models/tournament_option.rb b/app/models/tournament_option.rb
deleted file mode 100644
index 242a6f6..0000000
--- a/app/models/tournament_option.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class TournamentOption < ActiveRecord::Base
- belongs_to :tournament
-end
diff --git a/app/models/tournament_preference.rb b/app/models/tournament_preference.rb
new file mode 100644
index 0000000..1f335e3
--- /dev/null
+++ b/app/models/tournament_preference.rb
@@ -0,0 +1,3 @@
+class TournamentPreference < ActiveRecord::Base
+ belongs_to :tournament
+end
diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb
index 727c002..9fe255c 100644
--- a/app/views/matches/_form.html.erb
+++ b/app/views/matches/_form.html.erb
@@ -27,6 +27,10 @@
<%= f.label :winner_id %>
<%= f.text_field :winner_id %>
+
+ <%= f.label :remote_id %>
+ <%= f.text_field :remote_id %>
+
<%= f.submit %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index 400efb4..8d699f9 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -7,6 +7,7 @@
Tournament |
Name |
Winner |
+ Remote |
|
|
|
@@ -20,6 +21,7 @@
<%= match.tournament %> |
<%= match.name %> |
<%= match.winner %> |
+ <%= match.remote_id %> |
<%= link_to 'Show', match %> |
<%= link_to 'Edit', edit_match_path(match) %> |
<%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %> |
diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder
index 1a63f5f..18f172d 100644
--- a/app/views/matches/index.json.jbuilder
+++ b/app/views/matches/index.json.jbuilder
@@ -1,4 +1,4 @@
json.array!(@matches) do |match|
- json.extract! match, :id, :status, :tournament_id, :name, :winner_id
+ json.extract! match, :id, :status, :tournament_id, :name, :winner_id, :remote_id
json.url match_url(match, format: :json)
end
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index f3fc822..1ee7f1d 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -20,5 +20,10 @@
<%= @match.winner %>
+
+ Remote:
+ <%= @match.remote_id %>
+
+
<%= link_to 'Edit', edit_match_path(@match) %> |
<%= link_to 'Back', matches_path %>
diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder
index a3ef588..bfd2be4 100644
--- a/app/views/matches/show.json.jbuilder
+++ b/app/views/matches/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :created_at, :updated_at
+json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :remote_id, :created_at, :updated_at
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb
index 38855a0..fe92318 100644
--- a/app/views/tournaments/_form.html.erb
+++ b/app/views/tournaments/_form.html.erb
@@ -24,24 +24,8 @@
<%= f.number_field :status %>
- <%= f.label :min_players_per_team %>
- <%= f.number_field :min_players_per_team %>
-
-
- <%= f.label :max_players_per_team %>
- <%= f.number_field :max_players_per_team %>
-
-
- <%= f.label :min_teams_per_match %>
- <%= f.number_field :min_teams_per_match %>
-
-
- <%= f.label :max_teams_per_match %>
- <%= f.number_field :max_teams_per_match %>
-
-
- <%= f.label :set_rounds %>
- <%= f.number_field :set_rounds %>
+ <%= f.label :ger %>
+ <%= f.text_field :ger %>
<%= f.label :randomized_teams %>
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb
index f8f21e7..96bb5ba 100644
--- a/app/views/tournaments/index.html.erb
+++ b/app/views/tournaments/index.html.erb
@@ -6,11 +6,7 @@
Name |
Game |
Status |
-
Min players per team |
-
Max players per team |
-
Min teams per match |
-
Max teams per match |
-
Set rounds |
+
Ger |
Randomized teams |
|
|
@@ -24,11 +20,7 @@
<%= tournament.name %> |
<%= tournament.game %> |
<%= tournament.status %> |
-
<%= tournament.min_players_per_team %> |
-
<%= tournament.max_players_per_team %> |
-
<%= tournament.min_teams_per_match %> |
-
<%= tournament.max_teams_per_match %> |
-
<%= tournament.set_rounds %> |
+
<%= tournament.ger %> |
<%= tournament.randomized_teams %> |
<%= link_to 'Show', tournament %> |
<%= link_to 'Edit', edit_tournament_path(tournament) %> |
diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder
index 4038f04..653442f 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, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams
+ json.extract! tournament, :id, :name, :game_id, :status, :ger, :randomized_teams
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 3cb6179..3657871 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -16,28 +16,8 @@
- Min players per team:
- <%= @tournament.min_players_per_team %>
-
-
-
- Max players per team:
- <%= @tournament.max_players_per_team %>
-
-
-
- Min teams per match:
- <%= @tournament.min_teams_per_match %>
-
-
-
- Max teams per match:
- <%= @tournament.max_teams_per_match %>
-
-
-
- Set rounds:
- <%= @tournament.set_rounds %>
+ Ger:
+ <%= @tournament.ger %>
diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder
index 27fd5c0..d70a27a 100644
--- a/app/views/tournaments/show.json.jbuilder
+++ b/app/views/tournaments/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @tournament, :id, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at
+json.extract! @tournament, :id, :name, :game_id, :status, :ger, :randomized_teams, :created_at, :updated_at
--
cgit v1.2.3-2-g168b