fix forum replies number

pull/83/head
Thibault Duplessis 2014-04-12 14:54:39 +02:00
parent 103fb63d39
commit 6dc007c564
2 changed files with 2 additions and 2 deletions

View File

@ -20,10 +20,9 @@ case class Topic(
closed: Boolean,
hidden: Boolean) {
def nbReplies = nbPosts - 1
def updatedAt(troll: Boolean): DateTime = troll.fold(updatedAtTroll, updatedAt)
def nbPosts(troll: Boolean): Int = troll.fold(nbPostsTroll, nbPosts)
def nbReplies(troll: Boolean): Int = nbPosts(troll) - 1
def lastPostId(troll: Boolean): String = troll.fold(lastPostIdTroll, lastPostId)
def open = !closed

View File

@ -23,6 +23,7 @@ case class TopicView(
def updatedAt = topic updatedAt troll
def nbPosts = topic nbPosts troll
def nbReplies = topic nbReplies troll
def lastPostId = topic lastPostId troll
def id = topic.id