Created
January 17, 2013 18:25
-
-
Save raddrick/4558245 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
field_type :address_type_check do | |
field :self do | |
type :text_field, :size => 25, :maxlength => 25 | |
end | |
validates :logic => lambda{|field| | |
errors.add(field_name, "Must have street names and numbers, and no groups of 3 consecutive letters. ") unless ((get_value.length>1) && (get_value.split(" ").count>1) && (get_value.split(/(\D)\1\1/).join == get_value) ) | |
# (get_value.length>1) | |
# && (get_value.split(" ").count>2) | |
# && (get_value.split(/(.)\1\1/).join != get_value) | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment