Merge branch 'pullreq-update-in-push' of https://github.com/odz/gitbucket into odz-pullreq-update-in-push

Conflicts:
	src/main/scala/app/PullRequestsController.scala
This commit is contained in:
takezoe
2013-11-30 02:35:21 +09:00
3 changed files with 42 additions and 22 deletions

View File

@@ -46,6 +46,18 @@ trait PullRequestService { self: IssuesService =>
commitIdFrom,
commitIdTo))
def getPullRequestsByRequest(userName: String, repositoryName: String, branch: String, closed: Boolean): List[PullRequest] =
Query(PullRequests)
.innerJoin(Issues).on { (t1, t2) => t1.byPrimaryKey(t2.userName, t2.repositoryName, t2.issueId) }
.filter { case (t1, t2) =>
(t1.requestUserName is userName.bind) &&
(t1.requestRepositoryName is repositoryName.bind) &&
(t1.requestBranch is branch.bind) &&
(t2.closed is closed.bind)
}
.map { case (t1, t2) => t1 }
.list
}
object PullRequestService {