Skip to content

Instantly share code, notes, and snippets.

@arturaz
Created November 15, 2013 14:24
Show Gist options
  • Save arturaz/7485096 to your computer and use it in GitHub Desktop.
Save arturaz/7485096 to your computer and use it in GitHub Desktop.
How do I turn this slick method into a subquery?
val myRank = (session: Session) => {
val mine = Ratings.filter(_.userId === user.id).map(mapper).
first()(session)
Ratings.filter { mapper(_) > mine }.map(_.length + 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment