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

Removed unnecessary attr_accessors

This commit is contained in:
2015-03-30 17:45:37 +00:00
parent 85a5cb3993
commit 9986c8b407
6 changed files with 6 additions and 8 deletions

View File

@@ -1,7 +1,6 @@
class Match < ActiveRecord::Base class Match < ActiveRecord::Base
belongs_to :tournament belongs_to :tournament
WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"] WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"]
attr_accessor :weight_max, :w1_name, :w1_name
def weight_max def weight_max
@guy = Wrestler.find(self.r_id) @guy = Wrestler.find(self.r_id)

View File

@@ -1,6 +1,5 @@
class Poolbracket class Poolbracket
attr_accessor :weight
def generateBracketMatches(matches,weight,highest_round) def generateBracketMatches(matches,weight,highest_round)
if weight.pool_bracket_type == "twoPoolsToSemi" if weight.pool_bracket_type == "twoPoolsToSemi"
matches = twoPoolsToSemi(matches,weight,highest_round) matches = twoPoolsToSemi(matches,weight,highest_round)

View File

@@ -1,7 +1,7 @@
class School < ActiveRecord::Base class School < ActiveRecord::Base
belongs_to :tournament belongs_to :tournament
has_many :wrestlers, dependent: :destroy has_many :wrestlers, dependent: :destroy
attr_accessor :score
#calculate score here #calculate score here
def score def score

View File

@@ -4,7 +4,7 @@ class Tournament < ActiveRecord::Base
has_many :matches, dependent: :destroy has_many :matches, dependent: :destroy
has_many :mats, dependent: :destroy has_many :mats, dependent: :destroy
has_many :wrestlers, through: :weights has_many :wrestlers, through: :weights
attr_accessor :upcomingMatches, :unfinishedMatches
serialize :matchups_array serialize :matchups_array
def unfinishedMatches def unfinishedMatches

View File

@@ -2,7 +2,7 @@ class Weight < ActiveRecord::Base
belongs_to :tournament belongs_to :tournament
has_many :wrestlers, dependent: :destroy has_many :wrestlers, dependent: :destroy
attr_accessor :pools, :bracket_size, :bracket_type, :poolRounds, :totalRounds attr_accessor :pools
before_save do before_save do
self.tournament.matchups_array = nil self.tournament.matchups_array = nil

View File

@@ -2,8 +2,8 @@ class Wrestler < ActiveRecord::Base
belongs_to :school belongs_to :school
belongs_to :weight belongs_to :weight
has_one :tournament, through: :weight has_one :tournament, through: :weight
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage, :poolNumber attr_accessor :poolNumber
before_save do before_save do
self.tournament.matchups_array = nil self.tournament.matchups_array = nil
self.tournament.save self.tournament.save