mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Resolve length issue in Slick.
https://github.com/slick/slick/issues/170
This commit is contained in:
@@ -49,12 +49,8 @@ trait IssuesService {
|
|||||||
* @return the count of the search result
|
* @return the count of the search result
|
||||||
*/
|
*/
|
||||||
def countIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
def countIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
|
||||||
repos: (String, String)*): Int = {
|
repos: (String, String)*): Int =
|
||||||
// TODO It must be _.length instead of map (_.issueId) list).length.
|
Query(searchIssueQuery(repos, condition, filterUser, onlyPullRequest).length).first
|
||||||
// But it does not work on Slick 1.0.1 (worked on Slick 1.0.0).
|
|
||||||
// https://github.com/slick/slick/issues/170
|
|
||||||
(searchIssueQuery(repos, condition, filterUser, onlyPullRequest) map (_.issueId) list).length
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Returns the Map which contains issue count for each labels.
|
* Returns the Map which contains issue count for each labels.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -201,13 +201,10 @@ trait RepositoryService { self: AccountService =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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).
|
|
||||||
// https://github.com/slick/slick/issues/170
|
|
||||||
private def getForkedCount(userName: String, repositoryName: String): Int =
|
private def getForkedCount(userName: String, repositoryName: String): Int =
|
||||||
Query(Repositories).filter { t =>
|
Query(Repositories.filter { t =>
|
||||||
(t.originUserName is userName.bind) && (t.originRepositoryName is repositoryName.bind)
|
(t.originUserName is userName.bind) && (t.originRepositoryName is repositoryName.bind)
|
||||||
}.list.length
|
}.length).first
|
||||||
|
|
||||||
|
|
||||||
def getForkedRepositories(userName: String, repositoryName: String): List[String] =
|
def getForkedRepositories(userName: String, repositoryName: String): List[String] =
|
||||||
|
|||||||
Reference in New Issue
Block a user