make private_type validation conditional

there are times when this won't be filled in
but the credential is still valid
bug/bundler_fix
David Maloney 2014-07-07 15:40:52 -05:00
parent b7cfc927c4
commit b52c13228c
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
1 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,8 @@ module Metasploit
# These values should be #demodularized from subclasses of
# `Metasploit::Credential::Private`
validates :private_type,
inclusion: { in: [ :password, :ntlm_hash, :ssh_key ] }
inclusion: { in: [ :password, :ntlm_hash, :ssh_key ] },
if: "private_type.present?"
# If we have no private we MUST have a public
validates :public,