Skip to content

Instantly share code, notes, and snippets.

@ajrouvoet
Created September 16, 2014 13:49
Show Gist options
  • Save ajrouvoet/fa30e5c9f90ae9ace5c6 to your computer and use it in GitHub Desktop.
Save ajrouvoet/fa30e5c9f90ae9ace5c6 to your computer and use it in GitHub Desktop.
import blogimplicits._
class BlogCtrl(db: Database) extends RestFullCtrl(Blogs, db) {
def parseId(s: String) = s.toInt
override val deserializer: PartialFunction[JValue, Blog] = {
case jobj:JObject => (jobj ~ ("author_id", 1))
.extract[Blog](defaultFormats, implicitly[Manifest[Blog]])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment