Skip to content

Instantly share code, notes, and snippets.

@edymerchk
Created April 17, 2014 22:48
Show Gist options
  • Select an option

  • Save edymerchk/11015803 to your computer and use it in GitHub Desktop.

Select an option

Save edymerchk/11015803 to your computer and use it in GitHub Desktop.
password_complexity
validate :password_complexity
def password_complexity
if password.present? and not password.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/)
errors.add :password, "debe incluir almenos una letra mayuscula, una miniscula y un numero"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment