Permalink
Browse files

validates_email_with_smtp method

  • Loading branch information...
1 parent ecaac07 commit 4df57184a36ccf094e817f66bc04c3b1f84fd816 Jussi Uusi-Illikainen committed Jan 19, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/validates_email_with_smtp.rb
@@ -8,8 +8,12 @@ def self.included(base)
end
module ClassMethods
- def validates_email_with_smtp(*args)
-
+ def validates_email_with_smtp(*attrs)
+ validates_each(attrs) do |record,attr,value|
+ if MailCheck.run(value).invalid?
+ record.errors.add(attr,:invalid, :value => value)
+ end
+ end
end
end
end

0 comments on commit 4df5718

Please sign in to comment.