Temporary fix for Slick 1.0.1.

Simple count query does not work on Slick 1.0.1 (but worked on Slick 1.0.0). Hmm...
This commit is contained in:
takezoe
2013-06-26 15:55:21 +09:00
parent 66a2480d2d
commit 1216c64272

View File

@@ -38,9 +38,10 @@ trait IssuesService {
* @param userName the filter user name required for "assigned" and "created_by" * @param userName the filter user name required for "assigned" and "created_by"
* @return the count of the search result * @return the count of the search result
*/ */
def countIssue(owner: String, repository: String, condition: IssueSearchCondition, filter: String, userName: Option[String]): Int = def countIssue(owner: String, repository: String, condition: IssueSearchCondition, filter: String, userName: Option[String]): Int = {
searchIssueQuery(owner, repository, condition, filter, userName) map (_.length) first // TODO It must be _.length instead of map (_.issueId) list).length. But it does not work on Slick 1.0.1 (worked on Slick 1.0.0).
(searchIssueQuery(owner, repository, condition, filter, userName) map (_.issueId) list).length
}
/** /**
* Returns the Map which contains issue count for each labels. * Returns the Map which contains issue count for each labels.
* *
@@ -75,7 +76,8 @@ trait IssuesService {
.map { case (labelName, t) => .map { case (labelName, t) =>
labelName ~ t.length labelName ~ t.length
} }
.list.toMap .list
.toMap
} }
/** /**