Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add(value: String, maybeDescription: Option[String] = None): Try[Int] = {
- if (findByValue(value).isDefined)
- Failure(new RuntimeException)
- else {
- val newId = (models returning models.map(_.id)) += makeObject(value = value, description = maybeDescription)
- Success(newId)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement