diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-22 01:53:05 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-22 01:53:05 -0400 |
commit | 257f6393e81ffaef00bb4a738973eaacba02d21e (patch) | |
tree | 2dd32c253bb6d52c7acc88c0eb93d26d2144cd67 /app/models | |
parent | aa8437947b28dda73bcfaf3caccb738e5e2f48b3 (diff) |
added match.win?(player) for checking if a player won a match or not
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/match.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/match.rb b/app/models/match.rb index ac74fe1..83d7d72 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -38,4 +38,8 @@ class Match < ActiveRecord::Base end #handle_asynchronously :is_match_over + def win?(player) + winner.players.include? player + end + end |