Add back in ssh_key_matches?()

This commit is contained in:
Tod Beardsley 2012-01-08 22:45:00 -06:00
parent a1668f2b23
commit badf62d8e0
1 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,13 @@ class Cred < ActiveRecord::Base
(self.ssh_private_keys | self.ssh_public_keys)
end
def ssh_key_matches?(other_cred)
return false unless self.ptype == "ssh_key"
return false unless other_cred.ptype == self.ptype
matches = self.ssh_private_keys
matches.include?(self) and matches.include?(other_cred)
end
end
end