1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

First crack at setting an owner for the tournament

This commit is contained in:
2015-10-23 08:53:29 -04:00
parent f204024b23
commit ad9ea9dc42
14 changed files with 76 additions and 72 deletions

View File

@@ -0,0 +1,6 @@
class AddUserIdToTournaments < ActiveRecord::Migration
def change
add_column :tournaments, :user_id, :integer
add_index :tournaments, :user_id
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150630170119) do
ActiveRecord::Schema.define(version: 20151023123932) do
create_table "matches", force: :cascade do |t|
t.integer "w1"
@@ -66,8 +66,11 @@ ActiveRecord::Schema.define(version: 20150630170119) do
t.datetime "updated_at"
t.text "tournament_type"
t.text "weigh_in_ref"
t.integer "user_id"
end
add_index "tournaments", ["user_id"], name: "index_tournaments_on_user_id"
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false

View File

@@ -6,8 +6,8 @@
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
if Rails.env.development?
User.create(email: 'test@test.com', password: 'password', password_confirmation: 'password')
Tournament.create(id: 200, name: 'test', address: 'some place', director: 'some guy', director_email: 'hismail@email.com', tournament_type: 'Pool to bracket')
User.create(id: 1, email: 'test@test.com', password: 'password', password_confirmation: 'password')
Tournament.create(id: 200, name: 'test', address: 'some place', director: 'some guy', director_email: 'hismail@email.com', tournament_type: 'Pool to bracket', user_id: 1)
School.create(id: 200, name: 'Central Crossing', tournament_id: 200)
School.create(id: 201, name: 'Turd Town', tournament_id: 200)
School.create(id: 202, name: 'Shit Show', tournament_id: 200)