Skip to content

Instantly share code, notes, and snippets.

@wfaler
Created January 18, 2011 01:11
Show Gist options
  • Save wfaler/783831 to your computer and use it in GitHub Desktop.
Save wfaler/783831 to your computer and use it in GitHub Desktop.
validator2.scala
/**
* Checks uniqueness of a Widget for create
*/
class UniqueValidator(func: => Long) extends Validator {
def getKey = "id"
def getReplaceModel = List[Tuple2[String, Any]]()
def isValid: Boolean = {
if (Widgets.find(func) == None) return true
else return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment