8
In my model all associated accounts are Long not normal integers. However, when handling the Scala form in the new Play! 2.0 I can only validate an Int number in a form and not a Long.
http://www.playframework.org/documentation/2.0/ScalaForms
Take the following form:
val clientForm: Form[Client] = Form(
mapping(
"id" -> number,
"name" -> text(minLength = 4),
"email" -> optional(text),
"phone" -> optional(text),
"address" -> text(minLength = 4),
"city" -> text(minLength = 2),
"province" -> text(minLength = 2),
"account_id" -> number
)
(Client.apply)(Client.unapply)
)
Where you see account_id I want to apply a Long, so how could I cast that in the simplest way possible? The Client.apply syntax is awesome for its simplicity but I'm open to options like mapping. Thanks!