Skip to content

Instantly share code, notes, and snippets.

@yuroyoro
Created November 17, 2009 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuroyoro/236767 to your computer and use it in GitHub Desktop.
Save yuroyoro/236767 to your computer and use it in GitHub Desktop.
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