Permalink
Browse files

enum.valueOf gone, replaced with Option(enum.withName)

  • Loading branch information...
1 parent 2646b2b commit da8e40a56593fd36a77932ba998935d9c31a6739 @indrajitr indrajitr committed May 5, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 persistence/record/src/main/scala/net/liftweb/record/field/EnumField.scala
@@ -89,7 +89,7 @@ trait EnumTypedField[EnumType <: Enumeration] extends TypedField[EnumType#Value]
def asJStringName: JValue = valueBox.map(v => JString(v.toString)) openOr (JNothing: JValue)
def setFromJStringName(jvalue: JValue): Box[EnumType#Value] = jvalue match {
case JNothing|JNull if optional_? => setBox(Empty)
- case JString(s) => setBox(enum.valueOf(s) ?~ ("Unknown value \"" + s + "\""))
+ case JString(s) => setBox(Option(enum.withName(s)) ?~ ("Unknown value \"" + s + "\""))
case other => setBox(FieldHelpers.expectedA("JString", other))
}

0 comments on commit da8e40a

Please sign in to comment.