Skip to content

Instantly share code, notes, and snippets.

@czottmann
Created January 23, 2009 09:33
Show Gist options
  • Save czottmann/50954 to your computer and use it in GitHub Desktop.
Save czottmann/50954 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