Merge with 98f20036211349caaed3b824f2392b7c85733193
authortgambet
Thu, 25 Aug 2011 16:32:36 -0400
changeset 98 862a94cf3a21
parent 97 40a45ab37edb (current diff)
parent 95 98f200362113 (diff)
child 101 7562c185d2fd
Merge with 98f20036211349caaed3b824f2392b7c85733193
--- a/src/main/scala/Main.scala	Thu Aug 25 16:30:01 2011 -0400
+++ b/src/main/scala/Main.scala	Thu Aug 25 16:32:36 2011 -0400
@@ -74,7 +74,7 @@
         def format(workout:Workout) = {
           import workout.{user => u, _}
           val uri = "%s://%s/user/%s/workout/%s" format (req.underlying.getScheme, host, user, id)
-          """{ "activity": "%s", "user": %s, "date": %d, "duration": %d, "distance": %f, "json": "%s", "gpx": "%s" }""" format (activity, user, date, distance, 12.0, uri+".json", uri+".gpx")
+          """{ "activity": "%s", "date": %d, "duration": %d, "distance": %f, "json": "%s", "gpx": "%s" }""" format (activity, date, distance, 12.0, uri+".json", uri+".gpx")
         }
         val jsonResponse = WorkoutDAO.getAllWorkoutsByUser(user) map { w => format(w) } mkString ("[ ", ", ", " ]")
         Ok ~> ContentType("application/json") ~> ResponseString(jsonResponse)
--- a/src/main/scala/Workout.scala	Thu Aug 25 16:30:01 2011 -0400
+++ b/src/main/scala/Workout.scala	Thu Aug 25 16:32:36 2011 -0400
@@ -50,6 +50,12 @@
                  @Key("c") coordinates:Option[(Double, Double, Option[Double])],
                  @Key("s") status:Option[String]) {
  
+  def c:Option[(Double, Double, Option[Double])] = {
+    val dbList = coordinates.asInstanceOf[Option[com.mongodb.BasicDBList]]
+    
+    null
+  }
+  
   def asJSON:String = {
     val tString = """"t": "%s"""" format timestamp.toString
     val cString = {