Home »
Code Examples »
Scala Code Examples
Scala - The Option approach is also used extensively in Play validation methods Code Example
The code for The Option approach is also used extensively in Play validation methods
verifying("If age is given, it must be greater than zero",
model =>
model.age match {
case Some(age) => age < 0
case None => true
}
)