diff --git a/src/main/scala/app/AccountController.scala b/src/main/scala/app/AccountController.scala index 099086f..0a7818c 100644 --- a/src/main/scala/app/AccountController.scala +++ b/src/main/scala/app/AccountController.scala @@ -38,7 +38,7 @@ post("/:userName/_edit", form)(ownerOnly { form => val userName = params("userName") - val currentDate = new java.sql.Timestamp(System.currentTimeMillis) + val currentDate = new java.sql.Timestamp(System.currentTimeMillis) // TODO make a common function to get the current timestamp. updateAccount(getAccountByUserName(userName).get.copy( mailAddress = form.mailAddress, url = form.url, diff --git a/src/main/scala/app/IssuesController.scala b/src/main/scala/app/IssuesController.scala index d068298..4ecdf53 100644 --- a/src/main/scala/app/IssuesController.scala +++ b/src/main/scala/app/IssuesController.scala @@ -127,7 +127,8 @@ getMilestone(owner, repository, milestoneId) match { case None => NotFound() case Some(m) => { - val currentDate = new Timestamp(System.currentTimeMillis) // TODO move to trait? + // TODO make a common function to get the current timestamp. + val currentDate = new Timestamp(System.currentTimeMillis) updateMilestone(m.copy(closedDate = Some(currentDate))) redirect("/%s/%s/issues/milestones".format(owner, repository)) } diff --git a/src/main/scala/app/UsersController.scala b/src/main/scala/app/UsersController.scala index 7b4bd7d..ddcbc42 100644 --- a/src/main/scala/app/UsersController.scala +++ b/src/main/scala/app/UsersController.scala @@ -36,6 +36,7 @@ }) post("/admin/users/_new", newForm)(adminOnly { form => + // TODO make a common function to get the current timestamp. val currentDate = new java.sql.Timestamp(System.currentTimeMillis) createAccount(Account( userName = form.userName, @@ -57,6 +58,7 @@ post("/admin/users/:name/_edit", editForm)(adminOnly { form => val userName = params("userName") + // TODO make a common function to get the current timestamp. val currentDate = new java.sql.Timestamp(System.currentTimeMillis) updateAccount(getAccountByUserName(userName).get.copy( password = form.password, diff --git a/src/main/scala/service/AccountService.scala b/src/main/scala/service/AccountService.scala index e55cf6f..e56fed4 100644 --- a/src/main/scala/service/AccountService.scala +++ b/src/main/scala/service/AccountService.scala @@ -27,6 +27,7 @@ account.lastLoginDate) def updateLastLoginDate(userName: String): Unit = + // TODO make a common function to get the current timestamp. Query(Accounts).filter(_.userName is userName.bind).map(_.lastLoginDate) .update(new java.sql.Timestamp(System.currentTimeMillis)) diff --git a/src/main/scala/service/RepositoryService.scala b/src/main/scala/service/RepositoryService.scala index f07851b..35fb366 100644 --- a/src/main/scala/service/RepositoryService.scala +++ b/src/main/scala/service/RepositoryService.scala @@ -27,6 +27,7 @@ // TODO insert default labels. + // TODO make a common function to get the current timestamp. val currentDate = new java.sql.Timestamp(System.currentTimeMillis) Repositories insert @@ -159,6 +160,7 @@ * Updates the last activity date of the repository. */ def updateLastActivityDate(userName: String, repositoryName: String): Unit = + // TODO make a common function to get the current timestamp. Query(Repositories) .filter { r => (r.userName is userName.bind) && (r.repositoryName is repositoryName.bind) } .map { _.lastActivityDate } @@ -169,6 +171,7 @@ */ def saveRepositoryOptions(userName: String, repositoryName: String, description: Option[String], defaultBranch: String, isPrivate: Boolean): Unit = + // TODO make a common function to get the current timestamp. Query(Repositories) .filter { r => (r.userName is userName.bind) && (r.repositoryName is repositoryName.bind) } .map { r => r.description.? ~ r.defaultBranch ~ r.isPrivate ~ r.updatedDate }