diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-16 13:53:32 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-20 14:29:04 +0300 |
commit | ca01c4c6484aa135234028e5e1ca5829adad1a50 (patch) | |
tree | c8033b1de6db640c7fab80d2a8f7a800a9d943d8 /app | |
parent | 98cede7ebeae9dac994b35b66be6aab14eb932b3 (diff) |
Remove Duplicated keys add UNIQUE index to fingerprint
Diffstat (limited to 'app')
-rw-r--r-- | app/models/key.rb | 2 |
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' } |