mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-08 07:22:38 +00:00
Destroy matches if a school wrestler or weight is destroyed
This commit is contained in:
@@ -8,6 +8,11 @@ class Wrestler < ActiveRecord::Base
|
||||
|
||||
validates :name, :weight_id, :school_id, presence: true
|
||||
|
||||
before_destroy do
|
||||
self.tournament.destroyAllMatches
|
||||
self.weight.resetAllSeeds
|
||||
end
|
||||
|
||||
before_create do
|
||||
self.tournament.destroyAllMatches
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user