-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
In our model we have a gender enumeration defined like so:
object Gender extends Enumeration {
type Gender = Value
val Male = Value(0, "male")
val Female = Value(1, "female")
val Other = Value(2, "other")
implicit val genderFormat = new PFormat[Gender.Value] {
def reads(json: JsValue) = JsSuccess(Gender.withName(json.as[String]))
def writes(myEnum: Gender.Value) = JsString(myEnum.toString)
}
}
case class User(userName: String,
firstName: Option[String] = None,
lastName: Option[String] = None,
gender: Option[Gender.Value] = None,
imageUrl: Option[String] = None,
tel: Option[String] = None,
id: Long = 0L)
after saving the record in the DB, the `gender becomes Some(0/1/2)`
How can we resolve this issue? Any help will be highly appreciated.
Metadata
Metadata
Assignees
Labels
No labels