summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-07 04:16:18 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-07 04:16:18 -0400
commitc3af0f5b51dfe842ad9e4c5ea93e202e26e818ac (patch)
treec22f1cc916d98c7271635ecae48b62e8ea128012
parent8e7ca204ab9a702be483621f4fe9df68b03ffec0 (diff)
Ran generate.sh
-rw-r--r--app/controllers/matches_controller.rb2
-rw-r--r--app/views/matches/_form.html.erb4
-rw-r--r--app/views/matches/index.html.erb2
-rw-r--r--app/views/matches/index.json.jbuilder2
-rw-r--r--app/views/matches/show.html.erb5
-rw-r--r--app/views/matches/show.json.jbuilder2
-rw-r--r--db/migrate/20140407041416_create_simple_captcha_data.rb (renamed from db/migrate/20140406195921_create_simple_captcha_data.rb)0
-rw-r--r--db/migrate/20140407081419_create_delayed_jobs.rb (renamed from db/migrate/20140406235927_create_delayed_jobs.rb)0
-rw-r--r--db/migrate/20140407081422_create_servers.rb (renamed from db/migrate/20140406235933_create_servers.rb)0
-rw-r--r--db/migrate/20140407081425_create_matches.rb (renamed from db/migrate/20140406235940_create_matches.rb)1
-rw-r--r--db/migrate/20140407081427_create_teams.rb (renamed from db/migrate/20140406235946_create_teams.rb)0
-rw-r--r--db/migrate/20140407081430_create_alerts.rb (renamed from db/migrate/20140406235952_create_alerts.rb)0
-rw-r--r--db/migrate/20140407081434_create_pms.rb (renamed from db/migrate/20140406235958_create_pms.rb)0
-rw-r--r--db/migrate/20140407081437_create_tournaments.rb (renamed from db/migrate/20140407000005_create_tournaments.rb)0
-rw-r--r--db/migrate/20140407081440_create_games.rb (renamed from db/migrate/20140407000011_create_games.rb)0
-rw-r--r--db/migrate/20140407081443_create_users.rb (renamed from db/migrate/20140407000017_create_users.rb)0
-rw-r--r--db/migrate/20140407081446_create_sessions.rb (renamed from db/migrate/20140407000024_create_sessions.rb)0
-rw-r--r--db/migrate/20140407081449_create_server_settings.rb (renamed from db/migrate/20140407000030_create_server_settings.rb)0
-rw-r--r--db/migrate/20140407081452_create_game_settings.rb (renamed from db/migrate/20140407000036_create_game_settings.rb)0
-rw-r--r--db/migrate/20140407081454_create_tournament_preferences.rb (renamed from db/migrate/20140407000042_create_tournament_preferences.rb)0
-rw-r--r--db/migrate/20140407081458_create_scores.rb (renamed from db/migrate/20140407000048_create_scores.rb)0
-rw-r--r--db/migrate/20140407081501_create_remote_usernames.rb (renamed from db/migrate/20140407000054_create_remote_usernames.rb)0
-rw-r--r--db/migrate/20140407081503_create_tournament_players_join_table.rb (renamed from db/migrate/20140407000100_create_tournament_players_join_table.rb)0
-rw-r--r--db/migrate/20140407081506_create_tournament_hosts_join_table.rb (renamed from db/migrate/20140407000106_create_tournament_hosts_join_table.rb)0
-rw-r--r--db/migrate/20140407081509_create_team_user_join_table.rb (renamed from db/migrate/20140407000112_create_team_user_join_table.rb)0
-rw-r--r--db/migrate/20140407081512_create_match_team_join_table.rb (renamed from db/migrate/20140407000118_create_match_team_join_table.rb)0
-rw-r--r--db/migrate/20140407081524_add_hidden_attrs_to_user.rb (renamed from db/migrate/20140407000143_add_hidden_attrs_to_user.rb)0
-rw-r--r--db/schema.rb3
-rw-r--r--test/controllers/matches_controller_test.rb4
-rw-r--r--test/fixtures/matches.yml2
30 files changed, 21 insertions, 6 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index 32108d9..968bb1e 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, :remote_id)
+ params.require(:match).permit(:status, :tournament_id, :name, :winner_id, :remote_id, :submitted_peer_evaluations)
end
end
diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb
index 9fe255c..bb33501 100644
--- a/app/views/matches/_form.html.erb
+++ b/app/views/matches/_form.html.erb
@@ -31,6 +31,10 @@
<%= f.label :remote_id %><br>
<%= f.text_field :remote_id %>
</div>
+ <div class="field">
+ <%= f.label :submitted_peer_evaluations %><br>
+ <%= f.number_field :submitted_peer_evaluations %>
+ </div>
<div class="actions">
<%= f.submit %>
</div>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index 8d699f9..7b7676a 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -8,6 +8,7 @@
<th>Name</th>
<th>Winner</th>
<th>Remote</th>
+ <th>Submitted peer evaluations</th>
<th></th>
<th></th>
<th></th>
@@ -22,6 +23,7 @@
<td><%= match.name %></td>
<td><%= match.winner %></td>
<td><%= match.remote_id %></td>
+ <td><%= match.submitted_peer_evaluations %></td>
<td><%= link_to 'Show', match %></td>
<td><%= link_to 'Edit', edit_match_path(match) %></td>
<td><%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %></td>
diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder
index 18f172d..8efb8f9 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, :remote_id
+ json.extract! match, :id, :status, :tournament_id, :name, :winner_id, :remote_id, :submitted_peer_evaluations
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 1ee7f1d..1164113 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -25,5 +25,10 @@
<%= @match.remote_id %>
</p>
+<p>
+ <strong>Submitted peer evaluations:</strong>
+ <%= @match.submitted_peer_evaluations %>
+</p>
+
<%= 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 bfd2be4..37496c9 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, :remote_id, :created_at, :updated_at
+json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :remote_id, :submitted_peer_evaluations, :created_at, :updated_at
diff --git a/db/migrate/20140406195921_create_simple_captcha_data.rb b/db/migrate/20140407041416_create_simple_captcha_data.rb
index 4573b20..4573b20 100644
--- a/db/migrate/20140406195921_create_simple_captcha_data.rb
+++ b/db/migrate/20140407041416_create_simple_captcha_data.rb
diff --git a/db/migrate/20140406235927_create_delayed_jobs.rb b/db/migrate/20140407081419_create_delayed_jobs.rb
index ec0dd93..ec0dd93 100644
--- a/db/migrate/20140406235927_create_delayed_jobs.rb
+++ b/db/migrate/20140407081419_create_delayed_jobs.rb
diff --git a/db/migrate/20140406235933_create_servers.rb b/db/migrate/20140407081422_create_servers.rb
index fbe1b02..fbe1b02 100644
--- a/db/migrate/20140406235933_create_servers.rb
+++ b/db/migrate/20140407081422_create_servers.rb
diff --git a/db/migrate/20140406235940_create_matches.rb b/db/migrate/20140407081425_create_matches.rb
index 31eea12..bdeb1cd 100644
--- a/db/migrate/20140406235940_create_matches.rb
+++ b/db/migrate/20140407081425_create_matches.rb
@@ -6,6 +6,7 @@ class CreateMatches < ActiveRecord::Migration
t.string :name
t.references :winner, index: true
t.string :remote_id
+ t.integer :submitted_peer_evaluations
t.timestamps
end
diff --git a/db/migrate/20140406235946_create_teams.rb b/db/migrate/20140407081427_create_teams.rb
index fdf9a68..fdf9a68 100644
--- a/db/migrate/20140406235946_create_teams.rb
+++ b/db/migrate/20140407081427_create_teams.rb
diff --git a/db/migrate/20140406235952_create_alerts.rb b/db/migrate/20140407081430_create_alerts.rb
index 68a8e10..68a8e10 100644
--- a/db/migrate/20140406235952_create_alerts.rb
+++ b/db/migrate/20140407081430_create_alerts.rb
diff --git a/db/migrate/20140406235958_create_pms.rb b/db/migrate/20140407081434_create_pms.rb
index 93bb5c6..93bb5c6 100644
--- a/db/migrate/20140406235958_create_pms.rb
+++ b/db/migrate/20140407081434_create_pms.rb
diff --git a/db/migrate/20140407000005_create_tournaments.rb b/db/migrate/20140407081437_create_tournaments.rb
index c0d8929..c0d8929 100644
--- a/db/migrate/20140407000005_create_tournaments.rb
+++ b/db/migrate/20140407081437_create_tournaments.rb
diff --git a/db/migrate/20140407000011_create_games.rb b/db/migrate/20140407081440_create_games.rb
index 5e4f56f..5e4f56f 100644
--- a/db/migrate/20140407000011_create_games.rb
+++ b/db/migrate/20140407081440_create_games.rb
diff --git a/db/migrate/20140407000017_create_users.rb b/db/migrate/20140407081443_create_users.rb
index 8032870..8032870 100644
--- a/db/migrate/20140407000017_create_users.rb
+++ b/db/migrate/20140407081443_create_users.rb
diff --git a/db/migrate/20140407000024_create_sessions.rb b/db/migrate/20140407081446_create_sessions.rb
index f667f1e..f667f1e 100644
--- a/db/migrate/20140407000024_create_sessions.rb
+++ b/db/migrate/20140407081446_create_sessions.rb
diff --git a/db/migrate/20140407000030_create_server_settings.rb b/db/migrate/20140407081449_create_server_settings.rb
index dfdd91b..dfdd91b 100644
--- a/db/migrate/20140407000030_create_server_settings.rb
+++ b/db/migrate/20140407081449_create_server_settings.rb
diff --git a/db/migrate/20140407000036_create_game_settings.rb b/db/migrate/20140407081452_create_game_settings.rb
index b1caf5d..b1caf5d 100644
--- a/db/migrate/20140407000036_create_game_settings.rb
+++ b/db/migrate/20140407081452_create_game_settings.rb
diff --git a/db/migrate/20140407000042_create_tournament_preferences.rb b/db/migrate/20140407081454_create_tournament_preferences.rb
index 991d659..991d659 100644
--- a/db/migrate/20140407000042_create_tournament_preferences.rb
+++ b/db/migrate/20140407081454_create_tournament_preferences.rb
diff --git a/db/migrate/20140407000048_create_scores.rb b/db/migrate/20140407081458_create_scores.rb
index 4ca0b0b..4ca0b0b 100644
--- a/db/migrate/20140407000048_create_scores.rb
+++ b/db/migrate/20140407081458_create_scores.rb
diff --git a/db/migrate/20140407000054_create_remote_usernames.rb b/db/migrate/20140407081501_create_remote_usernames.rb
index e265985..e265985 100644
--- a/db/migrate/20140407000054_create_remote_usernames.rb
+++ b/db/migrate/20140407081501_create_remote_usernames.rb
diff --git a/db/migrate/20140407000100_create_tournament_players_join_table.rb b/db/migrate/20140407081503_create_tournament_players_join_table.rb
index be240e8..be240e8 100644
--- a/db/migrate/20140407000100_create_tournament_players_join_table.rb
+++ b/db/migrate/20140407081503_create_tournament_players_join_table.rb
diff --git a/db/migrate/20140407000106_create_tournament_hosts_join_table.rb b/db/migrate/20140407081506_create_tournament_hosts_join_table.rb
index 7521d89..7521d89 100644
--- a/db/migrate/20140407000106_create_tournament_hosts_join_table.rb
+++ b/db/migrate/20140407081506_create_tournament_hosts_join_table.rb
diff --git a/db/migrate/20140407000112_create_team_user_join_table.rb b/db/migrate/20140407081509_create_team_user_join_table.rb
index f3b57fc..f3b57fc 100644
--- a/db/migrate/20140407000112_create_team_user_join_table.rb
+++ b/db/migrate/20140407081509_create_team_user_join_table.rb
diff --git a/db/migrate/20140407000118_create_match_team_join_table.rb b/db/migrate/20140407081512_create_match_team_join_table.rb
index c2ed1b7..c2ed1b7 100644
--- a/db/migrate/20140407000118_create_match_team_join_table.rb
+++ b/db/migrate/20140407081512_create_match_team_join_table.rb
diff --git a/db/migrate/20140407000143_add_hidden_attrs_to_user.rb b/db/migrate/20140407081524_add_hidden_attrs_to_user.rb
index 9b5c505..9b5c505 100644
--- a/db/migrate/20140407000143_add_hidden_attrs_to_user.rb
+++ b/db/migrate/20140407081524_add_hidden_attrs_to_user.rb
diff --git a/db/schema.rb b/db/schema.rb
index f4612b8..9214da8 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: 20140407000143) do
+ActiveRecord::Schema.define(version: 20140407081524) do
create_table "alerts", force: true do |t|
t.integer "author_id"
@@ -75,6 +75,7 @@ ActiveRecord::Schema.define(version: 20140407000143) do
t.string "name"
t.integer "winner_id"
t.string "remote_id"
+ t.integer "submitted_peer_evaluations"
t.datetime "created_at"
t.datetime "updated_at"
end
diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb
index 8782b2c..aca7008 100644
--- a/test/controllers/matches_controller_test.rb
+++ b/test/controllers/matches_controller_test.rb
@@ -18,7 +18,7 @@ class MatchesControllerTest < ActionController::TestCase
test "should create match" do
assert_difference('Match.count') do
- post :create, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, tournament_id: @match.tournament_id, winner_id: @match.winner_id }
+ post :create, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, submitted_peer_evaluations: @match.submitted_peer_evaluations, tournament_id: @match.tournament_id, winner_id: @match.winner_id }
end
assert_redirected_to match_path(assigns(:match))
@@ -35,7 +35,7 @@ class MatchesControllerTest < ActionController::TestCase
end
test "should update match" do
- patch :update, id: @match, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, tournament_id: @match.tournament_id, winner_id: @match.winner_id }
+ patch :update, id: @match, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, submitted_peer_evaluations: @match.submitted_peer_evaluations, tournament_id: @match.tournament_id, winner_id: @match.winner_id }
assert_redirected_to match_path(assigns(:match))
end
diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml
index 8e86062..f64a72e 100644
--- a/test/fixtures/matches.yml
+++ b/test/fixtures/matches.yml
@@ -6,6 +6,7 @@ one:
name: MyString
winner_id:
remote_id: MyString
+ submitted_peer_evaluations: 1
two:
status: 1
@@ -13,3 +14,4 @@ two:
name: MyString
winner_id:
remote_id: MyString
+ submitted_peer_evaluations: 1