11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/validates_email_address_of.rb', line 11
def validate_each (record, attribute, value)
options = default_options.merge(self.options)
if options[:format] && check_format(value) == false
record.errors.add(attribute, options[:message])
return
end
if options[:mx] && check_mx(value) == false
record.errors.add(attribute, options[:message])
return
end
if options[:smtp] && check_smtp(value) == false
record.errors.add(attribute, options[:message])
end
end
|