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