Skip to content

Instantly share code, notes, and snippets.

@hmans
Created January 25, 2009 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hmans/52530 to your computer and use it in GitHub Desktop.
Save hmans/52530 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
validates_uniqueness_of :email, :case_sensitive => false
validate :valid_email?
private
def valid_email?
address = EmailVeracity::Address.new(email)
unless address.valid?
errors.add(:email, address.errors.join(", "))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment