21 22 23
# File 'lib/rails3.rb', line 21 def validate_each(object, attribute, value) object.errors.add(attribute, "is an invalid UK postcode") unless value =~ Postcodes::UK end