mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Swap page is now working and also moved swaping logic from tournament model to its own class
This commit is contained in:
@@ -4,16 +4,16 @@ class Wrestler < ActiveRecord::Base
|
||||
has_one :tournament, through: :weight
|
||||
has_many :matches, through: :weight
|
||||
has_many :deductedPoints, class_name: "Teampointadjust"
|
||||
attr_accessor :poolNumber, :poolAdvancePoints, :swapId
|
||||
attr_accessor :poolNumber, :poolAdvancePoints, :originalId, :swapId
|
||||
|
||||
validates :name, :weight_id, :school_id, presence: true
|
||||
|
||||
before_destroy do
|
||||
self.tournament.destroyAllMatches
|
||||
# self.tournament.destroyAllMatches
|
||||
end
|
||||
|
||||
before_create do
|
||||
self.tournament.destroyAllMatches
|
||||
# self.tournament.destroyAllMatches
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user