From f5d36fc67d1994b7cc1ce02e7be2767ffcb47857 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Thu, 6 Mar 2014 17:25:40 -0500 Subject: new generate --- app/controllers/games_controller.rb | 2 +- app/controllers/teams_controller.rb | 2 +- app/controllers/tournaments_controller.rb | 2 +- app/models/game_attribute.rb | 3 -- app/models/game_option.rb | 2 + app/models/score.rb | 4 ++ app/models/team.rb | 1 + app/models/tournament_option.rb | 1 + app/models/tournament_user_pair.rb | 4 ++ app/views/games/_form.html.erb | 18 +++++-- app/views/games/index.html.erb | 12 +++-- app/views/games/index.json.jbuilder | 2 +- app/views/games/show.html.erb | 18 +++++-- app/views/games/show.json.jbuilder | 2 +- app/views/teams/_form.html.erb | 4 ++ app/views/teams/index.html.erb | 2 + app/views/teams/index.json.jbuilder | 2 +- app/views/teams/show.html.erb | 5 ++ app/views/teams/show.json.jbuilder | 2 +- app/views/tournaments/_form.html.erb | 28 +++++++++++ app/views/tournaments/index.html.erb | 14 ++++++ app/views/tournaments/index.json.jbuilder | 2 +- app/views/tournaments/show.html.erb | 35 +++++++++++++ app/views/tournaments/show.json.jbuilder | 2 +- db/migrate/20140306024707_create_servers.rb | 8 --- db/migrate/20140306024709_create_tournaments.rb | 9 ---- db/migrate/20140306024711_create_matches.rb | 10 ---- db/migrate/20140306024713_create_teams.rb | 8 --- db/migrate/20140306024715_create_alerts.rb | 10 ---- db/migrate/20140306024718_create_pms.rb | 11 ----- db/migrate/20140306024720_create_games.rb | 13 ----- db/migrate/20140306024722_create_users.rb | 13 ----- db/migrate/20140306024724_create_sessions.rb | 9 ---- .../20140306024727_create_game_attributes.rb | 11 ----- .../20140306024729_create_server_settings.rb | 8 --- .../20140306024731_create_user_team_pairs.rb | 10 ---- .../20140306024733_create_team_match_pairs.rb | 10 ---- .../20140306024735_create_tournament_options.rb | 8 --- .../20140306024744_add_hidden_attrs_to_user.rb | 8 --- db/migrate/20140306222309_create_servers.rb | 8 +++ db/migrate/20140306222314_create_tournaments.rb | 16 ++++++ db/migrate/20140306222320_create_matches.rb | 10 ++++ db/migrate/20140306222325_create_teams.rb | 9 ++++ db/migrate/20140306222330_create_alerts.rb | 10 ++++ db/migrate/20140306222336_create_pms.rb | 11 +++++ db/migrate/20140306222341_create_games.rb | 15 ++++++ db/migrate/20140306222347_create_users.rb | 13 +++++ db/migrate/20140306222352_create_sessions.rb | 9 ++++ .../20140306222357_create_server_settings.rb | 8 +++ .../20140306222402_create_tournament_options.rb | 12 +++++ db/migrate/20140306222407_create_game_options.rb | 11 +++++ db/migrate/20140306222412_create_scores.rb | 11 +++++ .../20140306222417_create_tournament_user_pairs.rb | 10 ++++ .../20140306222422_create_user_team_pairs.rb | 10 ++++ .../20140306222427_create_team_match_pairs.rb | 10 ++++ .../20140306222447_add_hidden_attrs_to_user.rb | 8 +++ db/schema.rb | 57 ++++++++++++++++++---- generate.sh | 14 ++++-- test/controllers/games_controller_test.rb | 4 +- test/controllers/teams_controller_test.rb | 4 +- test/controllers/tournaments_controller_test.rb | 4 +- test/fixtures/game_attributes.yml | 11 ----- test/fixtures/game_options.yml | 11 +++++ test/fixtures/games.yml | 16 +++--- test/fixtures/scores.yml | 11 +++++ test/fixtures/teams.yml | 14 ++---- test/fixtures/tournament_options.yml | 20 ++++---- test/fixtures/tournament_user_pairs.yml | 9 ++++ test/fixtures/tournaments.yml | 14 ++++++ test/models/game_attribute_test.rb | 7 --- test/models/game_option_test.rb | 7 +++ test/models/score_test.rb | 7 +++ test/models/tournament_user_pair_test.rb | 7 +++ 73 files changed, 479 insertions(+), 234 deletions(-) delete mode 100644 app/models/game_attribute.rb create mode 100644 app/models/game_option.rb create mode 100644 app/models/score.rb create mode 100644 app/models/tournament_user_pair.rb delete mode 100644 db/migrate/20140306024707_create_servers.rb delete mode 100644 db/migrate/20140306024709_create_tournaments.rb delete mode 100644 db/migrate/20140306024711_create_matches.rb delete mode 100644 db/migrate/20140306024713_create_teams.rb delete mode 100644 db/migrate/20140306024715_create_alerts.rb delete mode 100644 db/migrate/20140306024718_create_pms.rb delete mode 100644 db/migrate/20140306024720_create_games.rb delete mode 100644 db/migrate/20140306024722_create_users.rb delete mode 100644 db/migrate/20140306024724_create_sessions.rb delete mode 100644 db/migrate/20140306024727_create_game_attributes.rb delete mode 100644 db/migrate/20140306024729_create_server_settings.rb delete mode 100644 db/migrate/20140306024731_create_user_team_pairs.rb delete mode 100644 db/migrate/20140306024733_create_team_match_pairs.rb delete mode 100644 db/migrate/20140306024735_create_tournament_options.rb delete mode 100644 db/migrate/20140306024744_add_hidden_attrs_to_user.rb create mode 100644 db/migrate/20140306222309_create_servers.rb create mode 100644 db/migrate/20140306222314_create_tournaments.rb create mode 100644 db/migrate/20140306222320_create_matches.rb create mode 100644 db/migrate/20140306222325_create_teams.rb create mode 100644 db/migrate/20140306222330_create_alerts.rb create mode 100644 db/migrate/20140306222336_create_pms.rb create mode 100644 db/migrate/20140306222341_create_games.rb create mode 100644 db/migrate/20140306222347_create_users.rb create mode 100644 db/migrate/20140306222352_create_sessions.rb create mode 100644 db/migrate/20140306222357_create_server_settings.rb create mode 100644 db/migrate/20140306222402_create_tournament_options.rb create mode 100644 db/migrate/20140306222407_create_game_options.rb create mode 100644 db/migrate/20140306222412_create_scores.rb create mode 100644 db/migrate/20140306222417_create_tournament_user_pairs.rb create mode 100644 db/migrate/20140306222422_create_user_team_pairs.rb create mode 100644 db/migrate/20140306222427_create_team_match_pairs.rb create mode 100644 db/migrate/20140306222447_add_hidden_attrs_to_user.rb delete mode 100644 test/fixtures/game_attributes.yml create mode 100644 test/fixtures/game_options.yml create mode 100644 test/fixtures/scores.yml create mode 100644 test/fixtures/tournament_user_pairs.yml delete mode 100644 test/models/game_attribute_test.rb create mode 100644 test/models/game_option_test.rb create mode 100644 test/models/score_test.rb create mode 100644 test/models/tournament_user_pair_test.rb diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 4ecff17..5780152 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -69,6 +69,6 @@ class GamesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def game_params - params.require(:game).permit(:name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams) + params.require(:game).permit(:name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams) end end diff --git a/app/controllers/teams_controller.rb b/app/controllers/teams_controller.rb index f14c97f..ccd6781 100644 --- a/app/controllers/teams_controller.rb +++ b/app/controllers/teams_controller.rb @@ -69,6 +69,6 @@ class TeamsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def team_params - params[:team] + params.require(:team).permit(:match_id) end end diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 720305f..346e16b 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(:game_id) + params.require(:tournament).permit(:game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status) end end diff --git a/app/models/game_attribute.rb b/app/models/game_attribute.rb deleted file mode 100644 index c12723b..0000000 --- a/app/models/game_attribute.rb +++ /dev/null @@ -1,3 +0,0 @@ -class GameAttribute < ActiveRecord::Base - belongs_to :game -end diff --git a/app/models/game_option.rb b/app/models/game_option.rb new file mode 100644 index 0000000..bdc5560 --- /dev/null +++ b/app/models/game_option.rb @@ -0,0 +1,2 @@ +class GameOption < ActiveRecord::Base +end diff --git a/app/models/score.rb b/app/models/score.rb new file mode 100644 index 0000000..a9b9c71 --- /dev/null +++ b/app/models/score.rb @@ -0,0 +1,4 @@ +class Score < ActiveRecord::Base + belongs_to :user + belongs_to :match +end diff --git a/app/models/team.rb b/app/models/team.rb index fa7ba9e..9e71557 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -1,2 +1,3 @@ class Team < ActiveRecord::Base + belongs_to :match end diff --git a/app/models/tournament_option.rb b/app/models/tournament_option.rb index 950b351..242a6f6 100644 --- a/app/models/tournament_option.rb +++ b/app/models/tournament_option.rb @@ -1,2 +1,3 @@ class TournamentOption < ActiveRecord::Base + belongs_to :tournament end diff --git a/app/models/tournament_user_pair.rb b/app/models/tournament_user_pair.rb new file mode 100644 index 0000000..eb4e9c5 --- /dev/null +++ b/app/models/tournament_user_pair.rb @@ -0,0 +1,4 @@ +class TournamentUserPair < ActiveRecord::Base + belongs_to :tournament + belongs_to :user +end diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb index 8941c59..f68e28f 100644 --- a/app/views/games/_form.html.erb +++ b/app/views/games/_form.html.erb @@ -16,12 +16,20 @@ <%= f.text_area :name %>
- <%= f.label :players_per_team %>
- <%= f.number_field :players_per_team %> + <%= f.label :min_players_per_team %>
+ <%= f.number_field :min_players_per_team %>
- <%= f.label :teams_per_match %>
- <%= f.number_field :teams_per_match %> + <%= 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 %>
@@ -29,7 +37,7 @@
<%= f.label :randomized_teams %>
- <%= f.number_field :randomized_teams %> + <%= f.check_box :randomized_teams %>
<%= f.submit %> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index ccd0f63..27c5860 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -4,8 +4,10 @@ Name - Players per team - Teams per match + Min players per team + Max players per team + Min teams per match + Max teams per match Set rounds Randomized teams @@ -18,8 +20,10 @@ <% @games.each do |game| %> <%= game.name %> - <%= game.players_per_team %> - <%= game.teams_per_match %> + <%= game.min_players_per_team %> + <%= game.max_players_per_team %> + <%= game.min_teams_per_match %> + <%= game.max_teams_per_match %> <%= game.set_rounds %> <%= game.randomized_teams %> <%= link_to 'Show', game %> diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder index 7e5c1a1..f8b3e96 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, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams + json.extract! game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams 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 7986016..1f1a154 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -6,13 +6,23 @@

- Players per team: - <%= @game.players_per_team %> + Min players per team: + <%= @game.min_players_per_team %>

- Teams per match: - <%= @game.teams_per_match %> + Max players per team: + <%= @game.max_players_per_team %> +

+ +

+ Min teams per match: + <%= @game.min_teams_per_match %> +

+ +

+ Max teams per match: + <%= @game.max_teams_per_match %>

diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder index 1a2d0c7..e689e7b 100644 --- a/app/views/games/show.json.jbuilder +++ b/app/views/games/show.json.jbuilder @@ -1 +1 @@ -json.extract! @game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at +json.extract! @game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at diff --git a/app/views/teams/_form.html.erb b/app/views/teams/_form.html.erb index fd10129..cdd4299 100644 --- a/app/views/teams/_form.html.erb +++ b/app/views/teams/_form.html.erb @@ -11,6 +11,10 @@

<% end %> +
+ <%= f.label :match_id %>
+ <%= f.text_field :match_id %> +
<%= f.submit %>
diff --git a/app/views/teams/index.html.erb b/app/views/teams/index.html.erb index b077e10..6a3188d 100644 --- a/app/views/teams/index.html.erb +++ b/app/views/teams/index.html.erb @@ -3,6 +3,7 @@ + @@ -12,6 +13,7 @@ <% @teams.each do |team| %> + diff --git a/app/views/teams/index.json.jbuilder b/app/views/teams/index.json.jbuilder index b29428b..ca0ec8b 100644 --- a/app/views/teams/index.json.jbuilder +++ b/app/views/teams/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@teams) do |team| - json.extract! team, :id + json.extract! team, :id, :match_id json.url team_url(team, format: :json) end diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb index 5b18d33..e41692a 100644 --- a/app/views/teams/show.html.erb +++ b/app/views/teams/show.html.erb @@ -1,4 +1,9 @@

<%= notice %>

+

+ Match: + <%= @team.match %> +

+ <%= link_to 'Edit', edit_team_path(@team) %> | <%= link_to 'Back', teams_path %> diff --git a/app/views/teams/show.json.jbuilder b/app/views/teams/show.json.jbuilder index 1538019..8a85dcc 100644 --- a/app/views/teams/show.json.jbuilder +++ b/app/views/teams/show.json.jbuilder @@ -1 +1 @@ -json.extract! @team, :id, :created_at, :updated_at +json.extract! @team, :id, :match_id, :created_at, :updated_at diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 1fd63e9..c2c0ba7 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -15,6 +15,34 @@ <%= f.label :game_id %>
<%= f.text_field :game_id %> +
+ <%= 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 :randomized_teams %>
+ <%= f.check_box :randomized_teams %> +
+
+ <%= f.label :status %>
+ <%= f.number_field :status %> +
<%= f.submit %>
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index ad2b7cf..dec16d1 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -4,6 +4,13 @@ + + + + + + + @@ -14,6 +21,13 @@ <% @tournaments.each do |tournament| %> + + + + + + + diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index e6f3b49..df8eee4 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 + json.extract! tournament, :id, :game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status 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 30df788..355bc90 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -5,5 +5,40 @@ <%= @tournament.game %>

+

+ 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 %> +

+ +

+ Randomized teams: + <%= @tournament.randomized_teams %> +

+ +

+ Status: + <%= @tournament.status %> +

+ <%= link_to 'Edit', edit_tournament_path(@tournament) %> | <%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder index 0fe65a6..7bedd4b 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :game_id, :created_at, :updated_at +json.extract! @tournament, :id, :game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status, :created_at, :updated_at diff --git a/db/migrate/20140306024707_create_servers.rb b/db/migrate/20140306024707_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140306024707_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024709_create_tournaments.rb b/db/migrate/20140306024709_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140306024709_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - t.references :game, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024711_create_matches.rb b/db/migrate/20140306024711_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140306024711_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024713_create_teams.rb b/db/migrate/20140306024713_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140306024713_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024715_create_alerts.rb b/db/migrate/20140306024715_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140306024715_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateAlerts < ActiveRecord::Migration - def change - create_table :alerts do |t| - t.references :author, index: true - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024718_create_pms.rb b/db/migrate/20140306024718_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140306024718_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreatePms < ActiveRecord::Migration - def change - create_table :pms do |t| - t.references :author, index: true - t.references :recipient, index: true - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024720_create_games.rb b/db/migrate/20140306024720_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140306024720_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateGames < ActiveRecord::Migration - def change - create_table :games do |t| - t.text :name - t.integer :players_per_team - t.integer :teams_per_match - t.integer :set_rounds - t.integer :randomized_teams - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024722_create_users.rb b/db/migrate/20140306024722_create_users.rb deleted file mode 100644 index 8032870..0000000 --- a/db/migrate/20140306024722_create_users.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.string :name - t.string :email - t.string :user_name - - t.timestamps - end - add_index :users, :email, unique: true - add_index :users, :user_name, unique: true - end -end diff --git a/db/migrate/20140306024724_create_sessions.rb b/db/migrate/20140306024724_create_sessions.rb deleted file mode 100644 index fe25bf2..0000000 --- a/db/migrate/20140306024724_create_sessions.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateSessions < ActiveRecord::Migration - def change - create_table :sessions do |t| - t.references :user, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024727_create_game_attributes.rb b/db/migrate/20140306024727_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140306024727_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateGameAttributes < ActiveRecord::Migration - def change - create_table :game_attributes do |t| - t.references :game, index: true - t.text :key - t.integer :type - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024729_create_server_settings.rb b/db/migrate/20140306024729_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140306024729_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024731_create_user_team_pairs.rb b/db/migrate/20140306024731_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140306024731_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateUserTeamPairs < ActiveRecord::Migration - def change - create_table :user_team_pairs do |t| - t.references :user, index: true - t.references :team, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024733_create_team_match_pairs.rb b/db/migrate/20140306024733_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140306024733_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateTeamMatchPairs < ActiveRecord::Migration - def change - create_table :team_match_pairs do |t| - t.references :team, index: true - t.references :match, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024735_create_tournament_options.rb b/db/migrate/20140306024735_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140306024735_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140306024744_add_hidden_attrs_to_user.rb b/db/migrate/20140306024744_add_hidden_attrs_to_user.rb deleted file mode 100644 index 2f1b0b2..0000000 --- a/db/migrate/20140306024744_add_hidden_attrs_to_user.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddHiddenAttrsToUser < ActiveRecord::Migration - def change - add_column :users, :password_digest, :string - add_column :users, :remember_token, :string - add_index :users, :remember_token, unique: true - add_column :users, :groups, :integer - end -end diff --git a/db/migrate/20140306222309_create_servers.rb b/db/migrate/20140306222309_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140306222309_create_servers.rb @@ -0,0 +1,8 @@ +class CreateServers < ActiveRecord::Migration + def change + create_table :servers do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222314_create_tournaments.rb b/db/migrate/20140306222314_create_tournaments.rb new file mode 100644 index 0000000..c7ec765 --- /dev/null +++ b/db/migrate/20140306222314_create_tournaments.rb @@ -0,0 +1,16 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + t.references :game, index: true + t.integer :min_players_per_team + t.integer :max_players_per_team + t.integer :min_teams_per_match + t.integer :max_teams_per_match + t.integer :set_rounds + t.boolean :randomized_teams + t.integer :status + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222320_create_matches.rb b/db/migrate/20140306222320_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140306222320_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222325_create_teams.rb b/db/migrate/20140306222325_create_teams.rb new file mode 100644 index 0000000..fdf9a68 --- /dev/null +++ b/db/migrate/20140306222325_create_teams.rb @@ -0,0 +1,9 @@ +class CreateTeams < ActiveRecord::Migration + def change + create_table :teams do |t| + t.references :match, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222330_create_alerts.rb b/db/migrate/20140306222330_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140306222330_create_alerts.rb @@ -0,0 +1,10 @@ +class CreateAlerts < ActiveRecord::Migration + def change + create_table :alerts do |t| + t.references :author, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222336_create_pms.rb b/db/migrate/20140306222336_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140306222336_create_pms.rb @@ -0,0 +1,11 @@ +class CreatePms < ActiveRecord::Migration + def change + create_table :pms do |t| + t.references :author, index: true + t.references :recipient, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222341_create_games.rb b/db/migrate/20140306222341_create_games.rb new file mode 100644 index 0000000..5e4f56f --- /dev/null +++ b/db/migrate/20140306222341_create_games.rb @@ -0,0 +1,15 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.text :name + t.integer :min_players_per_team + t.integer :max_players_per_team + t.integer :min_teams_per_match + t.integer :max_teams_per_match + t.integer :set_rounds + t.boolean :randomized_teams + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222347_create_users.rb b/db/migrate/20140306222347_create_users.rb new file mode 100644 index 0000000..8032870 --- /dev/null +++ b/db/migrate/20140306222347_create_users.rb @@ -0,0 +1,13 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :name + t.string :email + t.string :user_name + + t.timestamps + end + add_index :users, :email, unique: true + add_index :users, :user_name, unique: true + end +end diff --git a/db/migrate/20140306222352_create_sessions.rb b/db/migrate/20140306222352_create_sessions.rb new file mode 100644 index 0000000..fe25bf2 --- /dev/null +++ b/db/migrate/20140306222352_create_sessions.rb @@ -0,0 +1,9 @@ +class CreateSessions < ActiveRecord::Migration + def change + create_table :sessions do |t| + t.references :user, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222357_create_server_settings.rb b/db/migrate/20140306222357_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140306222357_create_server_settings.rb @@ -0,0 +1,8 @@ +class CreateServerSettings < ActiveRecord::Migration + def change + create_table :server_settings do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222402_create_tournament_options.rb b/db/migrate/20140306222402_create_tournament_options.rb new file mode 100644 index 0000000..53b601c --- /dev/null +++ b/db/migrate/20140306222402_create_tournament_options.rb @@ -0,0 +1,12 @@ +class CreateTournamentOptions < ActiveRecord::Migration + def change + create_table :tournament_options do |t| + t.references :tournament, index: true + t.integer :vartype + t.string :name + t.text :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222407_create_game_options.rb b/db/migrate/20140306222407_create_game_options.rb new file mode 100644 index 0000000..2f62ef7 --- /dev/null +++ b/db/migrate/20140306222407_create_game_options.rb @@ -0,0 +1,11 @@ +class CreateGameOptions < ActiveRecord::Migration + def change + create_table :game_options do |t| + t.integer :vartype + t.string :name + t.text :default + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222412_create_scores.rb b/db/migrate/20140306222412_create_scores.rb new file mode 100644 index 0000000..4ca0b0b --- /dev/null +++ b/db/migrate/20140306222412_create_scores.rb @@ -0,0 +1,11 @@ +class CreateScores < ActiveRecord::Migration + def change + create_table :scores do |t| + t.references :user, index: true + t.references :match, index: true + t.integer :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222417_create_tournament_user_pairs.rb b/db/migrate/20140306222417_create_tournament_user_pairs.rb new file mode 100644 index 0000000..ab72aad --- /dev/null +++ b/db/migrate/20140306222417_create_tournament_user_pairs.rb @@ -0,0 +1,10 @@ +class CreateTournamentUserPairs < ActiveRecord::Migration + def change + create_table :tournament_user_pairs do |t| + t.references :tournament, index: true + t.references :user, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222422_create_user_team_pairs.rb b/db/migrate/20140306222422_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140306222422_create_user_team_pairs.rb @@ -0,0 +1,10 @@ +class CreateUserTeamPairs < ActiveRecord::Migration + def change + create_table :user_team_pairs do |t| + t.references :user, index: true + t.references :team, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222427_create_team_match_pairs.rb b/db/migrate/20140306222427_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140306222427_create_team_match_pairs.rb @@ -0,0 +1,10 @@ +class CreateTeamMatchPairs < ActiveRecord::Migration + def change + create_table :team_match_pairs do |t| + t.references :team, index: true + t.references :match, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140306222447_add_hidden_attrs_to_user.rb b/db/migrate/20140306222447_add_hidden_attrs_to_user.rb new file mode 100644 index 0000000..2f1b0b2 --- /dev/null +++ b/db/migrate/20140306222447_add_hidden_attrs_to_user.rb @@ -0,0 +1,8 @@ +class AddHiddenAttrsToUser < ActiveRecord::Migration + def change + add_column :users, :password_digest, :string + add_column :users, :remember_token, :string + add_index :users, :remember_token, unique: true + add_column :users, :groups, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index b0d0766..eadf24e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140306024744) do +ActiveRecord::Schema.define(version: 20140306222447) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -22,22 +22,22 @@ ActiveRecord::Schema.define(version: 20140306024744) do add_index "alerts", ["author_id"], name: "index_alerts_on_author_id" - create_table "game_attributes", force: true do |t| - t.integer "game_id" - t.text "key" - t.integer "type" + create_table "game_options", force: true do |t| + t.integer "vartype" + t.string "name" + t.text "default" t.datetime "created_at" t.datetime "updated_at" end - add_index "game_attributes", ["game_id"], name: "index_game_attributes_on_game_id" - create_table "games", force: true do |t| t.text "name" - t.integer "players_per_team" - t.integer "teams_per_match" + t.integer "min_players_per_team" + t.integer "max_players_per_team" + t.integer "min_teams_per_match" + t.integer "max_teams_per_match" t.integer "set_rounds" - t.integer "randomized_teams" + t.boolean "randomized_teams" t.datetime "created_at" t.datetime "updated_at" end @@ -62,6 +62,17 @@ ActiveRecord::Schema.define(version: 20140306024744) do add_index "pms", ["author_id"], name: "index_pms_on_author_id" add_index "pms", ["recipient_id"], name: "index_pms_on_recipient_id" + create_table "scores", force: true do |t| + t.integer "user_id" + t.integer "match_id" + t.integer "value" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "scores", ["match_id"], name: "index_scores_on_match_id" + add_index "scores", ["user_id"], name: "index_scores_on_user_id" + create_table "server_settings", force: true do |t| t.datetime "created_at" t.datetime "updated_at" @@ -91,17 +102,43 @@ ActiveRecord::Schema.define(version: 20140306024744) do add_index "team_match_pairs", ["team_id"], name: "index_team_match_pairs_on_team_id" create_table "teams", force: true do |t| + t.integer "match_id" t.datetime "created_at" t.datetime "updated_at" end + add_index "teams", ["match_id"], name: "index_teams_on_match_id" + create_table "tournament_options", force: true do |t| + t.integer "tournament_id" + t.integer "vartype" + t.string "name" + t.text "value" t.datetime "created_at" t.datetime "updated_at" end + add_index "tournament_options", ["tournament_id"], name: "index_tournament_options_on_tournament_id" + + create_table "tournament_user_pairs", force: true do |t| + t.integer "tournament_id" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "tournament_user_pairs", ["tournament_id"], name: "index_tournament_user_pairs_on_tournament_id" + add_index "tournament_user_pairs", ["user_id"], name: "index_tournament_user_pairs_on_user_id" + create_table "tournaments", force: true do |t| t.integer "game_id" + t.integer "min_players_per_team" + t.integer "max_players_per_team" + t.integer "min_teams_per_match" + t.integer "max_teams_per_match" + t.integer "set_rounds" + t.boolean "randomized_teams" + t.integer "status" t.datetime "created_at" t.datetime "updated_at" end diff --git a/generate.sh b/generate.sh index fcd962f..c6e63dd 100755 --- a/generate.sh +++ b/generate.sh @@ -18,21 +18,25 @@ git checkout clean-start -- app test config/routes.rb # The whole shebang, models, views, and controllers bundle exec rails generate scaffold server --force $NOTEST -bundle exec rails generate scaffold tournament game:references $NOTEST +bundle exec rails generate scaffold tournament game:references min_players_per_team:integer max_players_per_team:integer min_teams_per_match:integer max_teams_per_match:integer set_rounds:integer randomized_teams:boolean status:integer $NOTEST bundle exec rails generate scaffold match tournament:references name:string --force $NOTEST -bundle exec rails generate scaffold team $NOTEST +bundle exec rails generate scaffold team match:references $NOTEST bundle exec rails generate scaffold alert author:references message:text $NOTEST bundle exec rails generate scaffold pm author:references recipient:references message:text $NOTEST -bundle exec rails generate scaffold game name:text players_per_team:integer teams_per_match:integer set_rounds:integer randomized_teams:integer --force $NOTEST +bundle exec rails generate scaffold game name:text min_players_per_team:integer max_players_per_team:integer min_teams_per_match:integer max_teams_per_match:integer set_rounds:integer randomized_teams:boolean --force $NOTEST bundle exec rails generate scaffold user name:string email:string:uniq user_name:string:uniq bundle exec rails generate scaffold session user:references + # Just models -bundle exec rails generate model game_attribute game:references key:text type:integer $NOTEST bundle exec rails generate model server_settings $NOTEST +bundle exec rails generate model tournament_option tournament:references vartype:integer name:string value:text $NOTEST +bundle exec rails generate model game_option vartype:integer name:string default:text $NOTEST +bundle exec rails generate model score user:references match:references value:integer $NOTEST +# Bridge Models +bundle exec rails generate model tournament_user_pair tournament:references user:references $NOTEST bundle exec rails generate model user_team_pair user:references team:references $NOTEST bundle exec rails generate model team_match_pair team:references match:references $NOTEST -bundle exec rails generate model tournament_option $NOTEST # Just controllers bundle exec rails generate controller search $NOTEST diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb index 95c3145..b93feac 100644 --- a/test/controllers/games_controller_test.rb +++ b/test/controllers/games_controller_test.rb @@ -18,7 +18,7 @@ class GamesControllerTest < ActionController::TestCase test "should create game" do assert_difference('Game.count') do - post :create, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } + post :create, game: { max_players_per_team: @game.max_players_per_team, max_teams_per_match: @game.max_teams_per_match, min_players_per_team: @game.min_players_per_team, min_teams_per_match: @game.min_teams_per_match, name: @game.name, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds } end assert_redirected_to game_path(assigns(:game)) @@ -35,7 +35,7 @@ class GamesControllerTest < ActionController::TestCase end test "should update game" do - patch :update, id: @game, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } + patch :update, id: @game, game: { max_players_per_team: @game.max_players_per_team, max_teams_per_match: @game.max_teams_per_match, min_players_per_team: @game.min_players_per_team, min_teams_per_match: @game.min_teams_per_match, name: @game.name, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds } assert_redirected_to game_path(assigns(:game)) end diff --git a/test/controllers/teams_controller_test.rb b/test/controllers/teams_controller_test.rb index 8bf60be..52f7c17 100644 --- a/test/controllers/teams_controller_test.rb +++ b/test/controllers/teams_controller_test.rb @@ -18,7 +18,7 @@ class TeamsControllerTest < ActionController::TestCase test "should create team" do assert_difference('Team.count') do - post :create, team: { } + post :create, team: { match_id: @team.match_id } end assert_redirected_to team_path(assigns(:team)) @@ -35,7 +35,7 @@ class TeamsControllerTest < ActionController::TestCase end test "should update team" do - patch :update, id: @team, team: { } + patch :update, id: @team, team: { match_id: @team.match_id } assert_redirected_to team_path(assigns(:team)) end diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb index bdbbfac..02e578a 100644 --- a/test/controllers/tournaments_controller_test.rb +++ b/test/controllers/tournaments_controller_test.rb @@ -18,7 +18,7 @@ class TournamentsControllerTest < ActionController::TestCase test "should create tournament" do assert_difference('Tournament.count') do - post :create, tournament: { game_id: @tournament.game_id } + post :create, tournament: { game_id: @tournament.game_id, max_players_per_team: @tournament.max_players_per_team, max_teams_per_match: @tournament.max_teams_per_match, min_players_per_team: @tournament.min_players_per_team, min_teams_per_match: @tournament.min_teams_per_match, randomized_teams: @tournament.randomized_teams, set_rounds: @tournament.set_rounds, status: @tournament.status } end assert_redirected_to tournament_path(assigns(:tournament)) @@ -35,7 +35,7 @@ class TournamentsControllerTest < ActionController::TestCase end test "should update tournament" do - patch :update, id: @tournament, tournament: { game_id: @tournament.game_id } + patch :update, id: @tournament, tournament: { game_id: @tournament.game_id, max_players_per_team: @tournament.max_players_per_team, max_teams_per_match: @tournament.max_teams_per_match, min_players_per_team: @tournament.min_players_per_team, min_teams_per_match: @tournament.min_teams_per_match, randomized_teams: @tournament.randomized_teams, set_rounds: @tournament.set_rounds, status: @tournament.status } assert_redirected_to tournament_path(assigns(:tournament)) end diff --git a/test/fixtures/game_attributes.yml b/test/fixtures/game_attributes.yml deleted file mode 100644 index eff7212..0000000 --- a/test/fixtures/game_attributes.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - game_id: - key: MyText - type: 1 - -two: - game_id: - key: MyText - type: 1 diff --git a/test/fixtures/game_options.yml b/test/fixtures/game_options.yml new file mode 100644 index 0000000..eb4760a --- /dev/null +++ b/test/fixtures/game_options.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + vartype: 1 + name: MyString + default: MyText + +two: + vartype: 1 + name: MyString + default: MyText diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml index 3068527..16f792e 100644 --- a/test/fixtures/games.yml +++ b/test/fixtures/games.yml @@ -2,14 +2,18 @@ one: name: MyText - players_per_team: 1 - teams_per_match: 1 + min_players_per_team: 1 + max_players_per_team: 1 + min_teams_per_match: 1 + max_teams_per_match: 1 set_rounds: 1 - randomized_teams: 1 + randomized_teams: false two: name: MyText - players_per_team: 1 - teams_per_match: 1 + min_players_per_team: 1 + max_players_per_team: 1 + min_teams_per_match: 1 + max_teams_per_match: 1 set_rounds: 1 - randomized_teams: 1 + randomized_teams: false diff --git a/test/fixtures/scores.yml b/test/fixtures/scores.yml new file mode 100644 index 0000000..26065df --- /dev/null +++ b/test/fixtures/scores.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + user_id: + match_id: + value: 1 + +two: + user_id: + match_id: + value: 1 diff --git a/test/fixtures/teams.yml b/test/fixtures/teams.yml index 937a0c0..4efc76e 100644 --- a/test/fixtures/teams.yml +++ b/test/fixtures/teams.yml @@ -1,11 +1,7 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value +one: + match_id: + +two: + match_id: diff --git a/test/fixtures/tournament_options.yml b/test/fixtures/tournament_options.yml index 937a0c0..aa5eaef 100644 --- a/test/fixtures/tournament_options.yml +++ b/test/fixtures/tournament_options.yml @@ -1,11 +1,13 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value +one: + tournament_id: + vartype: 1 + name: MyString + value: MyText + +two: + tournament_id: + vartype: 1 + name: MyString + value: MyText diff --git a/test/fixtures/tournament_user_pairs.yml b/test/fixtures/tournament_user_pairs.yml new file mode 100644 index 0000000..dbc4a88 --- /dev/null +++ b/test/fixtures/tournament_user_pairs.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + tournament_id: + user_id: + +two: + tournament_id: + user_id: diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml index 4cba7ca..c58a1ed 100644 --- a/test/fixtures/tournaments.yml +++ b/test/fixtures/tournaments.yml @@ -2,6 +2,20 @@ one: game_id: + min_players_per_team: 1 + max_players_per_team: 1 + min_teams_per_match: 1 + max_teams_per_match: 1 + set_rounds: 1 + randomized_teams: false + status: 1 two: game_id: + min_players_per_team: 1 + max_players_per_team: 1 + min_teams_per_match: 1 + max_teams_per_match: 1 + set_rounds: 1 + randomized_teams: false + status: 1 diff --git a/test/models/game_attribute_test.rb b/test/models/game_attribute_test.rb deleted file mode 100644 index 13c6e65..0000000 --- a/test/models/game_attribute_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class GameAttributeTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/game_option_test.rb b/test/models/game_option_test.rb new file mode 100644 index 0000000..1ae5701 --- /dev/null +++ b/test/models/game_option_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GameOptionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/score_test.rb b/test/models/score_test.rb new file mode 100644 index 0000000..d38cb0a --- /dev/null +++ b/test/models/score_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ScoreTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/tournament_user_pair_test.rb b/test/models/tournament_user_pair_test.rb new file mode 100644 index 0000000..c8d1789 --- /dev/null +++ b/test/models/tournament_user_pair_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentUserPairTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end -- cgit v1.2.3
Match
<%= team.match %> <%= link_to 'Show', team %> <%= link_to 'Edit', edit_team_path(team) %> <%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %>
GameMin players per teamMax players per teamMin teams per matchMax teams per matchSet roundsRandomized teamsStatus
<%= tournament.game %><%= tournament.min_players_per_team %><%= tournament.max_players_per_team %><%= tournament.min_teams_per_match %><%= tournament.max_teams_per_match %><%= tournament.set_rounds %><%= tournament.randomized_teams %><%= tournament.status %> <%= link_to 'Show', tournament %> <%= link_to 'Edit', edit_tournament_path(tournament) %> <%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %>