summaryrefslogtreecommitdiff
path: root/app/models/key.rb
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-06-16 12:53:32 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-06-20 13:29:04 +0200
commitca01c4c6484aa135234028e5e1ca5829adad1a50 (patch)
treec8033b1de6db640c7fab80d2a8f7a800a9d943d8 /app/models/key.rb
parent98cede7ebeae9dac994b35b66be6aab14eb932b3 (diff)
downloadgitlab-ce-ca01c4c6484aa135234028e5e1ca5829adad1a50.tar.gz
Remove Duplicated keys add UNIQUE index to fingerprint18697-uniqueness-key-validation
Diffstat (limited to 'app/models/key.rb')
-rw-r--r--app/models/key.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/key.rb b/app/models/key.rb
index 0532e84f47d..b9bc38a0436 100644
--- a/app/models/key.rb
+++ b/app/models/key.rb
@@ -9,7 +9,7 @@ class Key < ActiveRecord::Base
before_validation :strip_white_space, :generate_fingerprint
validates :title, presence: true, length: { within: 0..255 }
- validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\A(ssh|ecdsa)-.*\Z/ }, uniqueness: true
+ validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\A(ssh|ecdsa)-.*\Z/ }
validates :key, format: { without: /\n|\r/, message: 'should be a single line' }
validates :fingerprint, uniqueness: true, presence: { message: 'cannot be generated' }