fix user rank should not count disabled players

This commit is contained in:
Thibault Duplessis 2012-07-06 23:12:18 +02:00
parent 11d936da3e
commit 7fad9015d9
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@ case class UserInfo(
object UserInfo {
private val rankMinElo = 1600
private val rankMinElo = 1700
def apply(
userRepo: UserRepo,

View file

@ -34,7 +34,7 @@ extends SalatDAO[User, String](collection) {
}
def rank(user: User): IO[Int] = io {
count("elo" $gt user.elo).toInt + 1
count(DBObject("enabled" -> true) ++ ("elo" $gt user.elo)).toInt + 1
}
def setElo(id: String, elo: Int): IO[Unit] = io {