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
This commit is contained in:
Jean-Philippe Lang
2007-04-02 18:44:35 +00:00
parent bd8de9a6f8
commit 791077c240
13 changed files with 37 additions and 15 deletions
+3 -1
View File
@@ -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)