fix Period.id

This commit is contained in:
Thibault Duplessis 2015-07-25 18:41:57 +02:00
parent 04c10a5fae
commit 2a9f0c8b62

View file

@ -5,13 +5,15 @@ import scalaz.NonEmptyList
// contains aggregated data over (up to) 100 games
case class Period(
id: String, // random
_id: String, // random
userId: String,
data: UserStat,
from: DateTime,
to: DateTime,
computedAt: DateTime) {
def id = _id
def merge(o: Period) = copy(
data = data merge o.data,
from = from,
@ -39,7 +41,7 @@ object Period {
Computation(build(userId, pov), UserStat.emptyComputation aggregate pov)
def build(userId: String, pov: RichPov) = Period(
id = ornicar.scalalib.Random nextStringUppercase 8,
_id = ornicar.scalalib.Random nextStringUppercase 8,
userId = userId,
data = UserStat.empty,
from = pov.pov.game.createdAt,