Browse Source

verify Fixed play-scala's fortunes test

Mike Smith 11 years ago
parent
commit
3f1cd771c0

+ 1 - 1
play-scala/app/controllers/Application.scala

@@ -59,7 +59,7 @@ object Application extends Controller {
   def fortunes() = PredicatedAction(isDbAvailable, ServiceUnavailable) {
   def fortunes() = PredicatedAction(isDbAvailable, ServiceUnavailable) {
     Action.async {
     Action.async {
       Future(Fortune.getAll())(dbEc).map { fs =>
       Future(Fortune.getAll())(dbEc).map { fs =>
-        val fortunes =  Fortune(anorm.NotAssigned, "Additional fortune added at request time.") +: fs
+        val fortunes =  Fortune(0.toLong, "Additional fortune added at request time.") +: fs
         Ok(views.html.fortune(fortunes))
         Ok(views.html.fortune(fortunes))
       }
       }
     }
     }

+ 2 - 2
play-scala/app/models/Fortune.scala

@@ -6,12 +6,12 @@ import anorm._
 import anorm.SqlParser._
 import anorm.SqlParser._
 import scala.language.postfixOps
 import scala.language.postfixOps
 
 
-case class Fortune(id: Pk[Long], message: String)
+case class Fortune(id: Long, message: String)
 
 
 object Fortune {
 object Fortune {
 
 
   val simpleRowParser = {
   val simpleRowParser = {
-    get[Pk[Long]]("fortune.id") ~
+    get[Long]("fortune.id") ~
     get[String]("fortune.message") map {
     get[String]("fortune.message") map {
       case id~message => Fortune(id, message)
       case id~message => Fortune(id, message)
     }
     }