mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Destroy matches if a school wrestler or weight is destroyed
This commit is contained in:
@@ -46,6 +46,9 @@ class Tournament < ActiveRecord::Base
|
||||
def destroyAllMatches
|
||||
matches.destroy_all
|
||||
end
|
||||
if Rails.env.production?
|
||||
handle_asynchronously :destroyAllMatches
|
||||
end
|
||||
|
||||
def matchesByRound(round)
|
||||
matches.joins(:weight).where(round: round).order("weights.max")
|
||||
|
||||
Reference in New Issue
Block a user