Add ssh key validation

This commit is contained in:
Dmitriy Zaporozhets 2012-08-29 07:13:29 +03:00
parent 8da05a4ff7
commit 5afb16e496
2 changed files with 2 additions and 1 deletions

View file

@ -10,6 +10,7 @@ class Key < ActiveRecord::Base
validates :key,
presence: true,
:format => { :with => /ssh-.{3} / },
length: { within: 0..5000 }
before_save :set_identifier