Review Board 1.5.4

Issue 162 -- abstract minLen, etc. out of MappedString

Updated 1 year, 8 months ago

David Pollak Reviewers
dpp, timperrett, marius, charles, heiko, joni, atsuhiko, jorge, naftoli, kris, indrajit, alexb, dlouwers, mstarzyk, rmellgren, jhoffman, probinett, jmadsen, mhartmann, jstrachan, jgoday
None LiftWeb-archive
https://liftweb.assembla.com/spaces/liftweb/tickets/162-record-field-helpers

dpp_issue_162

Created a StringValidators trait that can be mixed into any FieldIdentifier to give it valMinLen, valMaxLen, valRegEx, etc. methods.

The class must define ValueType (e.g., String or Box[String]) and methods to convert from ValueType to and from Box[String].  The methods operate on Box[String].  This means that it works for both MappedString and StringField.

I also changed the validation result type in Record back to List[FieldError], but added implicits from Box[Node], Node to List[FieldError] and Box[MyType] => Box[Node] to Box[MyType] => List[FieldError] to make the amount of breakage minimal.
Passes all existing tests
Ship it!
Posted 1 year, 8 months ago (June 1st, 2010, 12:25 p.m.)
looks good