diff options
author | Andrey Kumanyaev <me@zzet.org> | 2013-04-03 02:28:12 +0400 |
---|---|---|
committer | Andrey Kumanyaev <me@zzet.org> | 2013-04-03 06:20:52 +0400 |
commit | 41bbbb6df0300579867c4654d8662b38fa9f0a58 (patch) | |
tree | d690fe658cfa986167b7ee042bf07ea8a3bf3787 /app/models/key.rb | |
parent | 7af16bbb0fdce36cf8b7e43e5cd64a712dfdaa1d (diff) | |
download | gitlab-ce-41bbbb6df0300579867c4654d8662b38fa9f0a58.tar.gz |
Update model methods
Diffstat (limited to 'app/models/key.rb')
-rw-r--r-- | app/models/key.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/key.rb b/app/models/key.rb index 53eee511e13..ce62b802c0d 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -23,7 +23,7 @@ class Key < ActiveRecord::Base before_validation :strip_white_space validates :title, presence: true, length: { within: 0..255 } - validates :key, presence: true, length: { within: 0..5000 }, format: { :with => /ssh-.{3} / }, uniqueness: true + validates :key, presence: true, length: { within: 0..5000 }, format: { with: /ssh-.{3} / }, uniqueness: true validate :fingerprintable_key delegate :name, :email, to: :user, prefix: true @@ -48,7 +48,7 @@ class Key < ActiveRecord::Base end def is_deploy_key - !!project_id + project.present? end # projects that has this key |