Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Edited src/main/scala/org/liftblog/snippet/Index.scala via GitHub #18

Merged
merged 1 commit into from

2 participants

@czepol

I think that this code:
def commentsText(post: Post) = {
val comments = Comment.count(By(Comment.postid, post.id))
Text("Comments(%d)".format((comments)))
}
is better than this:
def commentsText(post: Post) = {
val comments = (Comment findAll By(Comment.postid, post.id)).length
Text("Comments(%d)".format((comments)))
}

@lkuczera lkuczera merged commit 05dd805 into lkuczera:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/main/scala/org/liftblog/snippet/Index.scala
View
2  src/main/scala/org/liftblog/snippet/Index.scala
@@ -37,7 +37,7 @@ class Index extends Logger {
//get number of comments for current post and bind html link in the view
def commentsText(post: Post) = {
- val comments = (Comment findAll By(Comment.postid, post.id)).length
+ val comments = Comment.count(By(Comment.postid, post.id))
Text("Comments(%d)".format((comments)))
}
Something went wrong with that request. Please try again.