Skip to content

Instantly share code, notes, and snippets.

@maletor
Created November 8, 2010 04:45
Show Gist options
  • Save maletor/667387 to your computer and use it in GitHub Desktop.
Save maletor/667387 to your computer and use it in GitHub Desktop.
def punch_asshole
if Shot.where("cup != 0 and round_id = ? and team_id = ?", round.id, game.away.id).count == 2
Player.includes(:shots).where("shots.cup == 0 and shots.round_id = ? and shots.team_id = ?", round.id, game.away.id).assholes += 1
end
if Shot.where("cup != 0 and round_id = ? and team_id = ?", round.id, game.home.id).count == 2
Player.includes(:shots).where("shots.cup == 0 and shots.round_id = ? and shots.team_id = ?", round.id, game.home.id).assholes += 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment