From 9986c8b40777e03caa415a4f7354150faa7e7ad6 Mon Sep 17 00:00:00 2001 From: jcwimer Date: Mon, 30 Mar 2015 17:45:37 +0000 Subject: [PATCH] Removed unnecessary attr_accessors --- app/models/match.rb | 1 - app/models/poolbracket.rb | 3 +-- app/models/school.rb | 2 +- app/models/tournament.rb | 2 +- app/models/weight.rb | 2 +- app/models/wrestler.rb | 4 ++-- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/models/match.rb b/app/models/match.rb index 2943ecd..69fbe66 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -1,7 +1,6 @@ class Match < ActiveRecord::Base belongs_to :tournament WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"] - attr_accessor :weight_max, :w1_name, :w1_name def weight_max @guy = Wrestler.find(self.r_id) diff --git a/app/models/poolbracket.rb b/app/models/poolbracket.rb index dc90c6e..0f516b8 100644 --- a/app/models/poolbracket.rb +++ b/app/models/poolbracket.rb @@ -1,6 +1,5 @@ class Poolbracket - attr_accessor :weight - + def generateBracketMatches(matches,weight,highest_round) if weight.pool_bracket_type == "twoPoolsToSemi" matches = twoPoolsToSemi(matches,weight,highest_round) diff --git a/app/models/school.rb b/app/models/school.rb index 0c9ff6b..da67374 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -1,7 +1,7 @@ class School < ActiveRecord::Base belongs_to :tournament has_many :wrestlers, dependent: :destroy - attr_accessor :score + #calculate score here def score diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 05a9285..b1fa3e9 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -4,7 +4,7 @@ class Tournament < ActiveRecord::Base has_many :matches, dependent: :destroy has_many :mats, dependent: :destroy has_many :wrestlers, through: :weights - attr_accessor :upcomingMatches, :unfinishedMatches + serialize :matchups_array def unfinishedMatches diff --git a/app/models/weight.rb b/app/models/weight.rb index 54864a8..d41a472 100644 --- a/app/models/weight.rb +++ b/app/models/weight.rb @@ -2,7 +2,7 @@ class Weight < ActiveRecord::Base belongs_to :tournament has_many :wrestlers, dependent: :destroy - attr_accessor :pools, :bracket_size, :bracket_type, :poolRounds, :totalRounds + attr_accessor :pools before_save do self.tournament.matchups_array = nil diff --git a/app/models/wrestler.rb b/app/models/wrestler.rb index ef0d353..2641579 100644 --- a/app/models/wrestler.rb +++ b/app/models/wrestler.rb @@ -2,8 +2,8 @@ class Wrestler < ActiveRecord::Base belongs_to :school belongs_to :weight has_one :tournament, through: :weight - attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage, :poolNumber - + attr_accessor :poolNumber + before_save do self.tournament.matchups_array = nil self.tournament.save