summaryrefslogtreecommitdiff
path: root/app/models/key.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-12-12 17:44:56 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-12 17:52:06 +0000
commiteb839b9af51d411a6a35786a1c1c58954da1a650 (patch)
tree88a8ff1084be1a7bacf2b1557e04c5aa48434b6f /app/models/key.rb
parentce867db6b8b1b317ebe864d36d50fde5aad787d4 (diff)
parent3445136b9b0b8367b151170509fabe613389a50d (diff)
downloadgitlab-ce-eb839b9af51d411a6a35786a1c1c58954da1a650.tar.gz
Merge CSS
Diffstat (limited to 'app/models/key.rb')
-rw-r--r--app/models/key.rb16
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