(refs #498)Reformat counting pull request query

This commit is contained in:
Tomofumi Tanaka
2014-09-29 16:33:23 +09:00
parent 43babfed94
commit 9d1323a044
2 changed files with 8 additions and 7 deletions

View File

@@ -41,7 +41,8 @@ trait PullRequestService { self: IssuesService =>
.innerJoin(Issues).on { (t1, t2) => t1.byPrimaryKey(t2.userName, t2.repositoryName, t2.issueId) }
.innerJoin(Repositories).on { (t, t3) => t._2.byRepository(t3.userName, t3.repositoryName) }
.filter { case (t, t3) =>
(t._2.closed === closed.bind) && (
(t._2.closed === closed.bind) &&
(
(t3.isPrivate === false.bind) ||
(t3.userName === userName.bind) ||
(Collaborators.filter { t4 => t4.byRepository(t3.userName, t3.repositoryName) && (t4.collaboratorName === userName.bind)} exists)