cleanup rematch propositions in db

This commit is contained in:
Thibault Duplessis 2012-06-01 12:30:27 +02:00
parent f3ebb5211f
commit 103ac96039

View file

@ -118,7 +118,11 @@ class GameRepo(collection: MongoCollection)
}
def saveNext(game: DbGame, nextId: String): IO[Unit] = io {
update(idSelector(game), $set("next" -> nextId))
update(
idSelector(game),
$set("next" -> nextId) ++
$unset("players.0.isOfferingRematch", "players.1.isOfferingRematch")
)
}
def initialFen(gameId: String): IO[Option[String]] = io {