Created
November 17, 2009 08:09
-
-
Save yuroyoro/236767 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait MaxLenValidation { | |
val maxLen:Int | |
msg :String | |
override def validations = | |
valMaxLen( maxLen,msg )_ :: super.validations | |
} | |
class Memo extends LongKeyedMapper[Message] with IdPK { | |
def getSingleton = Message | |
object contents extends MappedString(this, 140) | |
with MaxLenValidation{ | |
val maxLen = 140 | |
val msg:String = "Too Long!" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment