summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 15:23:37 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 15:23:37 -0500
commit39f373778e73c54952dddd11e87f4ba354471622 (patch)
tree3c45c1a85e49306732f349ad2d239df58daeb843
parentb173c81942050940c99108f1eddd1e93dc3d8134 (diff)
parent50371ba04b52f74bfc2ceb05a429e072ad4848bb (diff)
Merge branch 'clean'
-rw-r--r--app/models/user_tournament_pair.rb4
-rw-r--r--db/migrate/20140306202154_create_servers.rb (renamed from db/migrate/20140306024707_create_servers.rb)0
-rw-r--r--db/migrate/20140306202156_create_tournaments.rb (renamed from db/migrate/20140306024709_create_tournaments.rb)0
-rw-r--r--db/migrate/20140306202158_create_matches.rb (renamed from db/migrate/20140306024711_create_matches.rb)0
-rw-r--r--db/migrate/20140306202200_create_teams.rb (renamed from db/migrate/20140306024713_create_teams.rb)0
-rw-r--r--db/migrate/20140306202202_create_alerts.rb (renamed from db/migrate/20140306024715_create_alerts.rb)0
-rw-r--r--db/migrate/20140306202204_create_pms.rb (renamed from db/migrate/20140306024718_create_pms.rb)0
-rw-r--r--db/migrate/20140306202207_create_games.rb (renamed from db/migrate/20140306024720_create_games.rb)0
-rw-r--r--db/migrate/20140306202209_create_users.rb (renamed from db/migrate/20140306024722_create_users.rb)0
-rw-r--r--db/migrate/20140306202211_create_sessions.rb (renamed from db/migrate/20140306024724_create_sessions.rb)0
-rw-r--r--db/migrate/20140306202213_create_game_attributes.rb (renamed from db/migrate/20140306024727_create_game_attributes.rb)0
-rw-r--r--db/migrate/20140306202215_create_server_settings.rb (renamed from db/migrate/20140306024729_create_server_settings.rb)0
-rw-r--r--db/migrate/20140306202217_create_tournament_options.rb (renamed from db/migrate/20140306024735_create_tournament_options.rb)0
-rw-r--r--db/migrate/20140306202219_create_user_team_pairs.rb (renamed from db/migrate/20140306024731_create_user_team_pairs.rb)0
-rw-r--r--db/migrate/20140306202222_create_user_tournament_pairs.rb10
-rw-r--r--db/migrate/20140306202224_create_team_match_pairs.rb (renamed from db/migrate/20140306024733_create_team_match_pairs.rb)0
-rw-r--r--db/migrate/20140306202232_add_hidden_attrs_to_user.rb (renamed from db/migrate/20140306024744_add_hidden_attrs_to_user.rb)0
-rw-r--r--db/schema.rb12
-rwxr-xr-xgenerate.sh4
-rw-r--r--test/fixtures/user_tournament_pairs.yml9
-rw-r--r--test/models/user_tournament_pair_test.rb7
21 files changed, 44 insertions, 2 deletions
diff --git a/app/models/user_tournament_pair.rb b/app/models/user_tournament_pair.rb
new file mode 100644
index 0000000..b2676e5
--- /dev/null
+++ b/app/models/user_tournament_pair.rb
@@ -0,0 +1,4 @@
+class UserTournamentPair < ActiveRecord::Base
+ belongs_to :user
+ belongs_to :tournament
+end
diff --git a/db/migrate/20140306024707_create_servers.rb b/db/migrate/20140306202154_create_servers.rb
index f33241a..f33241a 100644
--- a/db/migrate/20140306024707_create_servers.rb
+++ b/db/migrate/20140306202154_create_servers.rb
diff --git a/db/migrate/20140306024709_create_tournaments.rb b/db/migrate/20140306202156_create_tournaments.rb
index 36fcf7e..36fcf7e 100644
--- a/db/migrate/20140306024709_create_tournaments.rb
+++ b/db/migrate/20140306202156_create_tournaments.rb
diff --git a/db/migrate/20140306024711_create_matches.rb b/db/migrate/20140306202158_create_matches.rb
index 325863d..325863d 100644
--- a/db/migrate/20140306024711_create_matches.rb
+++ b/db/migrate/20140306202158_create_matches.rb
diff --git a/db/migrate/20140306024713_create_teams.rb b/db/migrate/20140306202200_create_teams.rb
index dd8397d..dd8397d 100644
--- a/db/migrate/20140306024713_create_teams.rb
+++ b/db/migrate/20140306202200_create_teams.rb
diff --git a/db/migrate/20140306024715_create_alerts.rb b/db/migrate/20140306202202_create_alerts.rb
index 68a8e10..68a8e10 100644
--- a/db/migrate/20140306024715_create_alerts.rb
+++ b/db/migrate/20140306202202_create_alerts.rb
diff --git a/db/migrate/20140306024718_create_pms.rb b/db/migrate/20140306202204_create_pms.rb
index 93bb5c6..93bb5c6 100644
--- a/db/migrate/20140306024718_create_pms.rb
+++ b/db/migrate/20140306202204_create_pms.rb
diff --git a/db/migrate/20140306024720_create_games.rb b/db/migrate/20140306202207_create_games.rb
index 59d4ef0..59d4ef0 100644
--- a/db/migrate/20140306024720_create_games.rb
+++ b/db/migrate/20140306202207_create_games.rb
diff --git a/db/migrate/20140306024722_create_users.rb b/db/migrate/20140306202209_create_users.rb
index 8032870..8032870 100644
--- a/db/migrate/20140306024722_create_users.rb
+++ b/db/migrate/20140306202209_create_users.rb
diff --git a/db/migrate/20140306024724_create_sessions.rb b/db/migrate/20140306202211_create_sessions.rb
index fe25bf2..fe25bf2 100644
--- a/db/migrate/20140306024724_create_sessions.rb
+++ b/db/migrate/20140306202211_create_sessions.rb
diff --git a/db/migrate/20140306024727_create_game_attributes.rb b/db/migrate/20140306202213_create_game_attributes.rb
index b63f134..b63f134 100644
--- a/db/migrate/20140306024727_create_game_attributes.rb
+++ b/db/migrate/20140306202213_create_game_attributes.rb
diff --git a/db/migrate/20140306024729_create_server_settings.rb b/db/migrate/20140306202215_create_server_settings.rb
index dfdd91b..dfdd91b 100644
--- a/db/migrate/20140306024729_create_server_settings.rb
+++ b/db/migrate/20140306202215_create_server_settings.rb
diff --git a/db/migrate/20140306024735_create_tournament_options.rb b/db/migrate/20140306202217_create_tournament_options.rb
index d2df22e..d2df22e 100644
--- a/db/migrate/20140306024735_create_tournament_options.rb
+++ b/db/migrate/20140306202217_create_tournament_options.rb
diff --git a/db/migrate/20140306024731_create_user_team_pairs.rb b/db/migrate/20140306202219_create_user_team_pairs.rb
index 2c492ac..2c492ac 100644
--- a/db/migrate/20140306024731_create_user_team_pairs.rb
+++ b/db/migrate/20140306202219_create_user_team_pairs.rb
diff --git a/db/migrate/20140306202222_create_user_tournament_pairs.rb b/db/migrate/20140306202222_create_user_tournament_pairs.rb
new file mode 100644
index 0000000..9885b20
--- /dev/null
+++ b/db/migrate/20140306202222_create_user_tournament_pairs.rb
@@ -0,0 +1,10 @@
+class CreateUserTournamentPairs < ActiveRecord::Migration
+ def change
+ create_table :user_tournament_pairs do |t|
+ t.references :user, index: true
+ t.references :tournament, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140306024733_create_team_match_pairs.rb b/db/migrate/20140306202224_create_team_match_pairs.rb
index 8fac07e..8fac07e 100644
--- a/db/migrate/20140306024733_create_team_match_pairs.rb
+++ b/db/migrate/20140306202224_create_team_match_pairs.rb
diff --git a/db/migrate/20140306024744_add_hidden_attrs_to_user.rb b/db/migrate/20140306202232_add_hidden_attrs_to_user.rb
index 2f1b0b2..2f1b0b2 100644
--- a/db/migrate/20140306024744_add_hidden_attrs_to_user.rb
+++ b/db/migrate/20140306202232_add_hidden_attrs_to_user.rb
diff --git a/db/schema.rb b/db/schema.rb
index b0d0766..3a0ce17 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: 20140306202232) do
create_table "alerts", force: true do |t|
t.integer "author_id"
@@ -118,6 +118,16 @@ ActiveRecord::Schema.define(version: 20140306024744) do
add_index "user_team_pairs", ["team_id"], name: "index_user_team_pairs_on_team_id"
add_index "user_team_pairs", ["user_id"], name: "index_user_team_pairs_on_user_id"
+ create_table "user_tournament_pairs", force: true do |t|
+ t.integer "user_id"
+ t.integer "tournament_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "user_tournament_pairs", ["tournament_id"], name: "index_user_tournament_pairs_on_tournament_id"
+ add_index "user_tournament_pairs", ["user_id"], name: "index_user_tournament_pairs_on_user_id"
+
create_table "users", force: true do |t|
t.string "name"
t.string "email"
diff --git a/generate.sh b/generate.sh
index fcd962f..aca13bb 100755
--- a/generate.sh
+++ b/generate.sh
@@ -30,9 +30,11 @@ 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 $NOTEST
+
bundle exec rails generate model user_team_pair user:references team:references $NOTEST
+bundle exec rails generate model user_tournament_pair user:references tournament:references
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/fixtures/user_tournament_pairs.yml b/test/fixtures/user_tournament_pairs.yml
new file mode 100644
index 0000000..974ee71
--- /dev/null
+++ b/test/fixtures/user_tournament_pairs.yml
@@ -0,0 +1,9 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+one:
+ user_id:
+ tournament_id:
+
+two:
+ user_id:
+ tournament_id:
diff --git a/test/models/user_tournament_pair_test.rb b/test/models/user_tournament_pair_test.rb
new file mode 100644
index 0000000..6167ff6
--- /dev/null
+++ b/test/models/user_tournament_pair_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class UserTournamentPairTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end