finished the writeup for password complexity

This commit is contained in:
Ken Johnson
2013-06-03 01:11:51 -04:00
parent 88ea613da6
commit 912c34a26e
3 changed files with 107 additions and 1 deletions
+2 -1
View File
@@ -4,7 +4,8 @@ class User < ActiveRecord::Base
validates :password, :presence => true,
:confirmation => true,
:length => {:within => 6..40},
:on => :create
:on => :create#,
#:format => {:with => /\A.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\@\#\$\%\^\&\+\=]).*\z/}
validates_presence_of :email
validates_uniqueness_of :email
validates_format_of :email, :with => /.+@.+\..+/i