Removed duplicated code from exemplary validations for password
This commit is contained in:
+2
-3
@@ -4,11 +4,10 @@ class User < ActiveRecord::Base
|
||||
:confirmation => true,
|
||||
:length => {:within => 6..40},
|
||||
:on => :create,
|
||||
:if => :password#,
|
||||
=begin :format => {:with => /\A.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\@\#\$\%\^\&\+\=]).*\z/}
|
||||
:if => :password
|
||||
=begin
|
||||
validates :password, :presence => true,
|
||||
:confirmation => true,
|
||||
:on => :update,
|
||||
:if => :password,
|
||||
:format => {:with => /\A.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\@\#\$\%\^\&\+\=]).*\z/}
|
||||
=end
|
||||
|
||||
Reference in New Issue
Block a user