Add the condition function by the primary key.

This commit is contained in:
shimamoto
2013-06-29 04:44:29 +09:00
parent c7d6a56ea2
commit a3133fa128
7 changed files with 14 additions and 0 deletions

View File

@@ -11,6 +11,9 @@ object Milestones extends Table[Milestone]("MILESTONE") with BasicTemplate with
def * = userName ~ repositoryName ~ milestoneId ~ title ~ description.? ~ dueDate.? ~ closedDate.? <> (Milestone, Milestone.unapply _)
def autoInc = userName ~ repositoryName ~ title ~ description.? ~ dueDate.? ~ closedDate.? returning milestoneId
// TODO create a template?
def byPrimaryKey(owner: String, repository: String, milestoneId: Int) =
byRepository(owner, repository) && (this.milestoneId is milestoneId.bind)
}
case class Milestone(