Advertisement
Guest User

Untitled

a guest
Apr 29th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.29 KB | None | 0 0
  1.   def add(value: String, maybeDescription: Option[String] = None): Long = {
  2.     if (findByValue(value).isDefined)
  3.       throw new RuntimeException
  4.     else {
  5.       val newId = (models returning models.map(_.id)) += makeObject(value = value, description = maybeDescription)
  6.  
  7.  
  8.       newId
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement