From dda6b0ab63eb8080e34b4273cfb6aadb7a29c028 Mon Sep 17 00:00:00 2001 From: miks Date: Sat, 31 Dec 2011 19:40:38 +0200 Subject: [PATCH] Unused validator deleted --- lib/unique_public_key_validator.rb | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 lib/unique_public_key_validator.rb 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