finished write-up for broken auth

This commit is contained in:
cktricky
2013-11-14 10:47:27 -05:00
parent 5fff355181
commit b84c8d4cc7
3 changed files with 21 additions and 7 deletions
+7 -1
View File
@@ -5,7 +5,13 @@ class User < ActiveRecord::Base
:length => {:within => 6..40},
:on => :create,
:if => :password#,
#:format => {:with => /\A.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\@\#\$\%\^\&\+\=]).*\z/}
=begin :format => {:with => /\A.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\@\#\$\%\^\&\+\=]).*\z/}
validates :password, :presence => true,
:confirmation => true,
:on => :update,
:if => :password,
:format => {:with => /\A.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\@\#\$\%\^\&\+\=]).*\z/}
=end
validates_presence_of :email
validates_uniqueness_of :email
validates_format_of :email, :with => /.+@.+\..+/i