diff --git a/app/controllers/weights_controller.rb b/app/controllers/weights_controller.rb index 3aba682..fc45ea7 100644 --- a/app/controllers/weights_controller.rb +++ b/app/controllers/weights_controller.rb @@ -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 diff --git a/app/models/mat.rb b/app/models/mat.rb index 7399548..7907f1a 100644 --- a/app/models/mat.rb +++ b/app/models/mat.rb @@ -1,4 +1,3 @@ class Mat < ActiveRecord::Base belongs_to :tournament - has_many :weights, dependent: :destroy end diff --git a/app/views/static_pages/brackets.html.erb b/app/views/static_pages/brackets.html.erb index f1b493e..d43452b 100644 --- a/app/views/static_pages/brackets.html.erb +++ b/app/views/static_pages/brackets.html.erb @@ -1,7 +1,7 @@ <%= link_to "Back to #{@tournament.name} weights", "/static_pages/weights?tournament=#{@tournament.id}" %>

-

<%= @weight.max %> lbs Bracket <%= Mat.find(@weight.mat_id).name %>

+

<%= @weight.max %> lbs Bracket

<% if @bracket_size == 10 %> <%= render 'man10' %> <% elsif @bracket_size == 9 %> diff --git a/app/views/weights/_form.html.erb b/app/views/weights/_form.html.erb index 39ff553..eabd963 100644 --- a/app/views/weights/_form.html.erb +++ b/app/views/weights/_form.html.erb @@ -24,13 +24,6 @@ <%= f.collection_select :tournament_id, Tournament.all, :id, :name %> <% end %> - -
- <%= f.label 'Assigned Mat' %>
- <%= f.collection_select :mat_id, @mats, :id, :name %> - -
-
<%= f.submit %> diff --git a/db/migrate/20140130153634_drop_weight_mat_id.rb b/db/migrate/20140130153634_drop_weight_mat_id.rb new file mode 100644 index 0000000..d1de3fb --- /dev/null +++ b/db/migrate/20140130153634_drop_weight_mat_id.rb @@ -0,0 +1,5 @@ +class DropWeightMatId < ActiveRecord::Migration + def change + remove_column :weights, :mat_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 1ea46c0..b1cd70e 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: 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|