Custom Length Validation Tokenizers in Rails Validations
Ryan Daigle notes that ActiveRecord's validates_length_of validator now accepts a "tokenizer" block to implement custom length validators. Sounds confusing, but is actually rather useful.
New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast.
A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.
Ryan Daigle notes that ActiveRecord's validates_length_of validator now accepts a "tokenizer" block to implement custom length validators. Sounds confusing, but is actually rather useful.