diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-12-12 20:44:56 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-12 20:52:06 +0300 |
commit | eb839b9af51d411a6a35786a1c1c58954da1a650 (patch) | |
tree | 88a8ff1084be1a7bacf2b1557e04c5aa48434b6f /app/models/key.rb | |
parent | ce867db6b8b1b317ebe864d36d50fde5aad787d4 (diff) | |
parent | 3445136b9b0b8367b151170509fabe613389a50d (diff) |
Merge CSS
Diffstat (limited to 'app/models/key.rb')
-rw-r--r-- | app/models/key.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/models/key.rb b/app/models/key.rb index c0a64cfb5fc..6f377f0e8ae 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -8,10 +8,18 @@ class Key < ActiveRecord::Base before_validation :generate_fingerprint - validates :title, presence: true, length: { within: 0..255 } - 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' } + validates :title, + presence: true, + length: { maximum: 255 } + validates :key, + presence: true, + length: { maximum: 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' } delegate :name, :email, to: :user, prefix: true |