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

Removed weight mat association

This commit is contained in:
Jacob Cody Wimer
2014-01-30 10:38:50 -05:00
parent eb5068f1b6
commit a3e1573c51
6 changed files with 7 additions and 12 deletions

View File

@@ -21,7 +21,6 @@ class WeightsController < ApplicationController
@tournament_field = params[:tournament]
@tournament = Tournament.find(params[:tournament])
end
@mats = Mat.where(tournament_id: @tournament.id)
end
# GET /weights/1/edit

View File

@@ -1,4 +1,3 @@
class Mat < ActiveRecord::Base
belongs_to :tournament
has_many :weights, dependent: :destroy
end

View File

@@ -1,7 +1,7 @@
<%= link_to "Back to #{@tournament.name} weights", "/static_pages/weights?tournament=#{@tournament.id}" %>
<br>
<br>
<h1><%= @weight.max %> lbs Bracket <%= Mat.find(@weight.mat_id).name %></h1>
<h1><%= @weight.max %> lbs Bracket</h1>
<% if @bracket_size == 10 %>
<%= render 'man10' %>
<% elsif @bracket_size == 9 %>

View File

@@ -24,13 +24,6 @@
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
</div>
<% end %>
<div class="field">
<%= f.label 'Assigned Mat' %><br>
<%= f.collection_select :mat_id, @mats, :id, :name %>
</div>
<div class="actions">
<%= f.submit %>

View File

@@ -0,0 +1,5 @@
class DropWeightMatId < ActiveRecord::Migration
def change
remove_column :weights, :mat_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: 20140125072649) do
ActiveRecord::Schema.define(version: 20140130153634) do
create_table "matches", force: true do |t|
t.integer "r_id"
@@ -75,7 +75,6 @@ ActiveRecord::Schema.define(version: 20140125072649) do
t.datetime "created_at"
t.datetime "updated_at"
t.integer "tournament_id"
t.integer "mat_id"
end
create_table "wrestlers", force: true do |t|