1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-06 06:04:33 +00:00

Fixed the way I swap wrestlers

This commit is contained in:
2016-01-25 01:11:35 +00:00
parent a9463d0f0c
commit f97557ec23
2 changed files with 24 additions and 27 deletions

View File

@@ -135,4 +135,15 @@ class Match < ActiveRecord::Base
wrestler1.generatePoolNumber
end
end
def swapWrestlers(wrestler1_id,wrestler2_id)
if self.m1 == wrestler1_id
self.m1 = wrestler2_id
self.save
elsif self.m2 == wrestler1_id
self.m2 = wrestler2_id
self.save
end
end
end