Created
March 13, 2013 03:21
-
-
Save MaxPresman/5149141 to your computer and use it in GitHub Desktop.
Revisions
-
MaxPresman created this gist
Mar 13, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ package models import anorm._ import play.api.db.DB import anorm.SqlParser._ import play.api.Play.current case class LogBucket( id: Int, label: String, description: String ) object row_definitions { val log_bucket = { get[Int]("id") ~ get[String]("label") ~ get[String]("description") map { case id~label~description => LogBucket(id, label,description) } } } object LogBucket { def all(): List[LogBucket] = DB.withConnection { implicit conn => SQL("select * from log_bucket").as(row_definitions.log_bucket *) } def create(label: String) {} def delete(id: Long) {} }