diff --git a/lib/unique_public_key_validator.rb b/lib/unique_public_key_validator.rb deleted file mode 100644 index b2306bda..00000000 --- a/lib/unique_public_key_validator.rb +++ /dev/null @@ -1,7 +0,0 @@ -class UniquePublicKeyValidator < ActiveModel::Validator - def validate(record) - if (DeployKey.where('key = ? AND id !=?', record.key , record.id).count > 0 || Key.where('key = ? AND id !=?', record.key , record.id).count > 0) - record.errors.add :key, 'already exist.' - end - end -end