class ZipcodeValidator
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/validate_zipcode/zipcode_validator.rb, line 2 def validate_each(record, attribute, value) unless ValidateZipcode::Validator.new(value, options[:country]).valid? record.errors[attribute] << (options[:message] || I18n.t("errors.messages.this_zip_code_is_invalid")) end end