Custom Validator

Have a look at validates_each. That allows you to perform validation
on an attribute (or attributes) with custom code.

validates_each :your_attribute do |model_instance, attribute, value|                                                            # your
validation code here checking the value                                                          end

-Michael http://javathehutt.blogspot.com