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

Fixed mat assignment when matches are finished

This commit is contained in:
2016-01-11 16:48:08 +00:00
parent a2c0a2763e
commit cce30bdf3a
3 changed files with 5 additions and 3 deletions

View File

@@ -79,7 +79,7 @@ class Tournament < ActiveRecord::Base
end
def resetMats
matchesToReset = matches.select{|m| m.finished != 1 && m.mat_id != nil}
matchesToReset = matches.select{|m| m.mat_id != nil}
# matchesToReset.update_all( {:mat_id => nil } )
matchesToReset.each do |m|
m.mat_id = nil