Running a Squeryl call for some data that pulls from multiple locations, but for some reason it returns as a unit. How do I get it to return as an Iterable?
Below is pulling of the data:
/**
* gets a stream for a particular user
*/
def getUserStream(userId:Long) {
User.teamIds(userId).toList.map( (team) =>
Stream.findByTeam(team,0,5).map( (stream) =>
List(stream)
).flatten
).flatten.sortBy(_.id)
}
And then outputting the data, where results returns as Unit
:
Stream.getUserStream(userId) match {
case results => {
Ok( generate(results.map( (stream) => Map(
"id" -> stream.id,
"model" -> stream.model,
"time" -> stream.time,
"content" -> stream.content
))
) ).as("application/json")
}
case _ => Ok("")
}
My initial guess is one function could return as a None, but wouldn't it just return an empty list?