Fix the inefficient query.
1 parent aca64cf commit 606e5e6e76836814a5ddc29a3e1c5dd85e78379d
@shimamoto shimamoto authored on 3 Jul 2013
Showing 5 changed files
View
4
src/main/scala/service/AccountService.scala
updatedDate = currentDate,
lastLoginDate = None)
 
def updateAccount(account: Account): Unit =
Query(Accounts)
Accounts
.filter { a => a.userName is account.userName.bind }
.map { a => a.password ~ a.mailAddress ~ a.isAdmin ~ a.url.? ~ a.registeredDate ~ a.updatedDate ~ a.lastLoginDate.? }
.update (
account.password,
currentDate,
account.lastLoginDate)
def updateLastLoginDate(userName: String): Unit =
Query(Accounts).filter(_.userName is userName.bind).map(_.lastLoginDate).update(currentDate)
Accounts.filter(_.userName is userName.bind).map(_.lastLoginDate).update(currentDate)
}
View
1
■■■■
src/main/scala/service/IssuesService.scala
}
.map { case (labelName, t) =>
labelName ~ t.length
}
.list
.toMap
}
 
/**
View
src/main/scala/service/LabelsService.scala
View
src/main/scala/service/MilestonesService.scala
View
src/main/scala/service/RepositoryService.scala