1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-08 23:34:51 +00:00

Swapping wrestlers works correctly now.

This commit is contained in:
2016-01-25 15:33:46 +00:00
parent dcd8ab3dc0
commit c46f895870
2 changed files with 14 additions and 19 deletions

View File

@@ -137,11 +137,11 @@ class Match < ActiveRecord::Base
end
def swapWrestlers(wrestler1_id,wrestler2_id)
if self.m1 == wrestler1_id
self.m1 = wrestler2_id
if self.w1 == wrestler1_id
self.w1 = wrestler2_id
self.save
elsif self.m2 == wrestler1_id
self.m2 = wrestler2_id
elsif self.w2 == wrestler1_id
self.w2 = wrestler2_id
self.save
end