From 257f6393e81ffaef00bb4a738973eaacba02d21e Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 22 Apr 2014 01:53:05 -0400 Subject: added match.win?(player) for checking if a player won a match or not --- app/models/match.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3-2-g168b