summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-05 21:50:24 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-05 21:50:24 -0500
commit5f5ce9123215bfc5b68e4521f2697bff1ea96595 (patch)
treead8ea3eab038db964493bc2ebf31a1b7b71bed56
parent91e8c1366f101837519b7dd1e5fa7b53473eb97b (diff)
parentd0545c2820d101a98b3c895cf6e3691145a62f3c (diff)
Merge branch 'clean'
Conflicts: app/controllers/users_controller.rb app/views/users/index.html.erb
-rw-r--r--app/views/users/index.html.erb1
-rw-r--r--db/migrate/20140306024707_create_servers.rb (renamed from db/migrate/20140306022626_create_servers.rb)0
-rw-r--r--db/migrate/20140306024709_create_tournaments.rb (renamed from db/migrate/20140306022628_create_tournaments.rb)0
-rw-r--r--db/migrate/20140306024711_create_matches.rb (renamed from db/migrate/20140306022631_create_matches.rb)0
-rw-r--r--db/migrate/20140306024713_create_teams.rb (renamed from db/migrate/20140306022633_create_teams.rb)0
-rw-r--r--db/migrate/20140306024715_create_alerts.rb (renamed from db/migrate/20140306022635_create_alerts.rb)0
-rw-r--r--db/migrate/20140306024718_create_pms.rb (renamed from db/migrate/20140306022638_create_pms.rb)0
-rw-r--r--db/migrate/20140306024720_create_games.rb (renamed from db/migrate/20140306022640_create_games.rb)0
-rw-r--r--db/migrate/20140306024722_create_users.rb (renamed from db/migrate/20140306022642_create_users.rb)2
-rw-r--r--db/migrate/20140306024724_create_sessions.rb (renamed from db/migrate/20140306022644_create_sessions.rb)0
-rw-r--r--db/migrate/20140306024727_create_game_attributes.rb (renamed from db/migrate/20140306022647_create_game_attributes.rb)0
-rw-r--r--db/migrate/20140306024729_create_server_settings.rb (renamed from db/migrate/20140306022649_create_server_settings.rb)0
-rw-r--r--db/migrate/20140306024731_create_user_team_pairs.rb (renamed from db/migrate/20140306022651_create_user_team_pairs.rb)0
-rw-r--r--db/migrate/20140306024733_create_team_match_pairs.rb (renamed from db/migrate/20140306022653_create_team_match_pairs.rb)0
-rw-r--r--db/migrate/20140306024735_create_tournament_options.rb (renamed from db/migrate/20140306022702_create_tournament_options.rb)0
-rw-r--r--db/migrate/20140306024744_add_hidden_attrs_to_user.rb8
-rw-r--r--db/schema.rb8
-rwxr-xr-xgenerate.sh9
-rw-r--r--test/controllers/users_controller_test.rb4
-rw-r--r--test/fixtures/users.yml4
20 files changed, 22 insertions, 14 deletions
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index d7b46da..89e369a 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -10,7 +10,6 @@
<th></th>
<th></th>
<th></th>
- <th></th>
</tr>
</thead>
diff --git a/db/migrate/20140306022626_create_servers.rb b/db/migrate/20140306024707_create_servers.rb
index f33241a..f33241a 100644
--- a/db/migrate/20140306022626_create_servers.rb
+++ b/db/migrate/20140306024707_create_servers.rb
diff --git a/db/migrate/20140306022628_create_tournaments.rb b/db/migrate/20140306024709_create_tournaments.rb
index 36fcf7e..36fcf7e 100644
--- a/db/migrate/20140306022628_create_tournaments.rb
+++ b/db/migrate/20140306024709_create_tournaments.rb
diff --git a/db/migrate/20140306022631_create_matches.rb b/db/migrate/20140306024711_create_matches.rb
index 325863d..325863d 100644
--- a/db/migrate/20140306022631_create_matches.rb
+++ b/db/migrate/20140306024711_create_matches.rb
diff --git a/db/migrate/20140306022633_create_teams.rb b/db/migrate/20140306024713_create_teams.rb
index dd8397d..dd8397d 100644
--- a/db/migrate/20140306022633_create_teams.rb
+++ b/db/migrate/20140306024713_create_teams.rb
diff --git a/db/migrate/20140306022635_create_alerts.rb b/db/migrate/20140306024715_create_alerts.rb
index 68a8e10..68a8e10 100644
--- a/db/migrate/20140306022635_create_alerts.rb
+++ b/db/migrate/20140306024715_create_alerts.rb
diff --git a/db/migrate/20140306022638_create_pms.rb b/db/migrate/20140306024718_create_pms.rb
index 93bb5c6..93bb5c6 100644
--- a/db/migrate/20140306022638_create_pms.rb
+++ b/db/migrate/20140306024718_create_pms.rb
diff --git a/db/migrate/20140306022640_create_games.rb b/db/migrate/20140306024720_create_games.rb
index 59d4ef0..59d4ef0 100644
--- a/db/migrate/20140306022640_create_games.rb
+++ b/db/migrate/20140306024720_create_games.rb
diff --git a/db/migrate/20140306022642_create_users.rb b/db/migrate/20140306024722_create_users.rb
index f416771..8032870 100644
--- a/db/migrate/20140306022642_create_users.rb
+++ b/db/migrate/20140306024722_create_users.rb
@@ -4,8 +4,6 @@ class CreateUsers < ActiveRecord::Migration
t.string :name
t.string :email
t.string :user_name
- t.string :password_digest
- t.string :remember_token
t.timestamps
end
diff --git a/db/migrate/20140306022644_create_sessions.rb b/db/migrate/20140306024724_create_sessions.rb
index fe25bf2..fe25bf2 100644
--- a/db/migrate/20140306022644_create_sessions.rb
+++ b/db/migrate/20140306024724_create_sessions.rb
diff --git a/db/migrate/20140306022647_create_game_attributes.rb b/db/migrate/20140306024727_create_game_attributes.rb
index b63f134..b63f134 100644
--- a/db/migrate/20140306022647_create_game_attributes.rb
+++ b/db/migrate/20140306024727_create_game_attributes.rb
diff --git a/db/migrate/20140306022649_create_server_settings.rb b/db/migrate/20140306024729_create_server_settings.rb
index dfdd91b..dfdd91b 100644
--- a/db/migrate/20140306022649_create_server_settings.rb
+++ b/db/migrate/20140306024729_create_server_settings.rb
diff --git a/db/migrate/20140306022651_create_user_team_pairs.rb b/db/migrate/20140306024731_create_user_team_pairs.rb
index 2c492ac..2c492ac 100644
--- a/db/migrate/20140306022651_create_user_team_pairs.rb
+++ b/db/migrate/20140306024731_create_user_team_pairs.rb
diff --git a/db/migrate/20140306022653_create_team_match_pairs.rb b/db/migrate/20140306024733_create_team_match_pairs.rb
index 8fac07e..8fac07e 100644
--- a/db/migrate/20140306022653_create_team_match_pairs.rb
+++ b/db/migrate/20140306024733_create_team_match_pairs.rb
diff --git a/db/migrate/20140306022702_create_tournament_options.rb b/db/migrate/20140306024735_create_tournament_options.rb
index d2df22e..d2df22e 100644
--- a/db/migrate/20140306022702_create_tournament_options.rb
+++ b/db/migrate/20140306024735_create_tournament_options.rb
diff --git a/db/migrate/20140306024744_add_hidden_attrs_to_user.rb b/db/migrate/20140306024744_add_hidden_attrs_to_user.rb
new file mode 100644
index 0000000..2f1b0b2
--- /dev/null
+++ b/db/migrate/20140306024744_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 ca583d1..b0d0766 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: 20140306022702) do
+ActiveRecord::Schema.define(version: 20140306024744) do
create_table "alerts", force: true do |t|
t.integer "author_id"
@@ -122,13 +122,15 @@ ActiveRecord::Schema.define(version: 20140306022702) do
t.string "name"
t.string "email"
t.string "user_name"
- t.string "password_digest"
- t.string "remember_token"
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "password_digest"
+ t.string "remember_token"
+ t.integer "groups"
end
add_index "users", ["email"], name: "index_users_on_email", unique: true
+ add_index "users", ["remember_token"], name: "index_users_on_remember_token", unique: true
add_index "users", ["user_name"], name: "index_users_on_user_name", unique: true
end
diff --git a/generate.sh b/generate.sh
index da55bca..fcd962f 100755
--- a/generate.sh
+++ b/generate.sh
@@ -24,7 +24,7 @@ bundle exec rails generate scaffold team $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 user name:string email:string:uniq user_name:string:uniq password_digest:string remember_token:string
+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
@@ -32,14 +32,19 @@ bundle exec rails generate model game_attribute game:references key:text type:in
bundle exec rails generate model server_settings $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
bundle exec rails generate controller main $NOTEST
bundle exec rails generate controller static $NOTEST
+# Migrations
+# By having these separate from the original 'generate', it makes it
+# not stick these in the views or anything.
+bundle exec rails generate migration AddHiddenAttrsToUser password_digest:string remember_token:string:uniq groups:integer
+
#for the tournament controller to generate options
-bundle exec rails generate model tournament_option $NOTEST
#bundle exec rails generate scaffold
bundle exec rake db:drop RAILS_ENV=development
diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb
index fc06f63..79a5700 100644
--- a/test/controllers/users_controller_test.rb
+++ b/test/controllers/users_controller_test.rb
@@ -18,7 +18,7 @@ class UsersControllerTest < ActionController::TestCase
test "should create user" do
assert_difference('User.count') do
- post :create, user: { email: @user.email, name: @user.name, password_digest: @user.password_digest, remember_token: @user.remember_token, user_name: @user.user_name }
+ post :create, user: { email: @user.email, name: @user.name, user_name: @user.user_name }
end
assert_redirected_to user_path(assigns(:user))
@@ -35,7 +35,7 @@ class UsersControllerTest < ActionController::TestCase
end
test "should update user" do
- patch :update, id: @user, user: { email: @user.email, name: @user.name, password_digest: @user.password_digest, remember_token: @user.remember_token, user_name: @user.user_name }
+ patch :update, id: @user, user: { email: @user.email, name: @user.name, user_name: @user.user_name }
assert_redirected_to user_path(assigns(:user))
end
diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml
index cf39694..ea3e874 100644
--- a/test/fixtures/users.yml
+++ b/test/fixtures/users.yml
@@ -4,12 +4,8 @@ one:
name: MyString
email: MyString
user_name: MyString
- password_digest: MyString
- remember_token: MyString
two:
name: MyString
email: MyString
user_name: MyString
- password_digest: MyString
- remember_token: MyString