diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-02 18:44:35 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-02 18:44:35 +0000 |
commit | 791077c240f74dd4e228fc5b8ac3d7a0c0d41f3a (patch) | |
tree | e53f43445c12850481f1a9df0e7929eaa0ae805f /app/models/project.rb | |
parent | bd8de9a6f84052f72930dac3c5ee2e353c249238 (diff) | |
download | redmine-791077c240f74dd4e228fc5b8ac3d7a0c0d41f3a.tar.gz redmine-791077c240f74dd4e228fc5b8ac3d7a0c0d41f3a.zip |
Added some attributes length validations.
Also added some information about attribute length constraints on forms.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@400 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 2419e720d..60a376768 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -35,8 +35,10 @@ class Project < ActiveRecord::Base validates_uniqueness_of :name, :identifier validates_associated :custom_values, :on => :update validates_associated :repository, :wiki + validates_length_of :name, :maximum => 30 validates_format_of :name, :with => /^[\w\s\'\-]*$/i - validates_length_of :identifier, :maximum => 12 + validates_length_of :description, :maximum => 255 + validates_length_of :identifier, :in => 3..12 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/ def identifier=(identifier) |