Avoiding silent truncation of your model fields requires putting length validations on them. But this can introduce duplication of knowledge. In this post I demonstrate how to pull limit information directly from the DB into your model validations.
François Beausoleil has a nice post up demonstrating “how to use AlterEgo with ActiveRecord”:http://blog.teksol.info/2008/12/09/how-to-use-alterego-with-activerecord.html. If you’re interested in introducing state-specific behaviors to your ActiveRecord objects, check it out!